Tech2 Forums - Powered by vBulletin

Urgent help in java

This is a topic on Urgent help in java within the Programmers Corner forums, part of the Technology category; I need to learn about how to create drop menus and text entering area and a draw figures along with ...

Results 1 to 10 of 10
  1. #1
    Uber Newbie
    Join Date
    Oct 2007
    Location
    shivamogga
    Posts
    20
    Liked
    0 times
    Reputation points
    0

    Urgent help in java

    I need to learn about how to create drop menus and text entering area and a draw figures along with when the user selects an option in menu I need to locate an object referring to that option on a rectangular board that I will have drawn along with some texts in that drawn rectangular box. Kindly suggest where I can learn that quickly. I know basics in core java.(all of these menus , board and texts should appear all at once that's the kind of project im trying to do )

  2. #2
    Tech2 Members ander's Avatar
    Join Date
    May 2011
    Location
    Bangalore
    Posts
    164
    Liked
    9 times
    Reputation points
    25

    Re: Urgent help in java

    You probably want to learn Swing. I haven't really learned it myself, so I can't recommend a book. You can google for online tutorials though.

    I did read a bit about Swing, and it looked quite simple to use. Shouldn't take you more than a few hours to learn everything you want to.
    I'm back, baby! =P

  3. #3
    Uber Newbie
    Join Date
    Oct 2007
    Location
    shivamogga
    Posts
    20
    Liked
    0 times
    Reputation points
    0

    Re: Urgent help in java

    thanks man. i'm studying them now. but here is another problem i have. I tried to execute a java program creating threads in java but it threw out too many errors and all of them were stating something related to threads. is there something that i have to download and put in "include" directory or should i import some statements ?

  4. #4
    Uber Newbie
    Join Date
    Oct 2007
    Location
    shivamogga
    Posts
    20
    Liked
    0 times
    Reputation points
    0

    Re: Urgent help in java

    Here is another. I created a program to read contents from a file and show it on output. but on compiling the error is mentioned as follows-" class ARead is public, should be declared in a file named ARead.java"
    Another error-"cannot find symbol BufferedReader br= new BufferedReader(fr);".
    What should i do ? Should i add some header files like in c and C++ ? if yes then, how ?

  5. #5
    Tech2 Members ander's Avatar
    Join Date
    May 2011
    Location
    Bangalore
    Posts
    164
    Liked
    9 times
    Reputation points
    25

    Re: Urgent help in java

    I'm not a pro Java dev but if you can post your code here, I can have a look. There are others here who are better than me and they'll probably help you too.
    I'm back, baby! =P

  6. #6
    Uber Newbie
    Join Date
    Oct 2007
    Location
    shivamogga
    Posts
    20
    Liked
    0 times
    Reputation points
    0

    Re: Urgent help in java

    Here is the program-
    [code=php:33xf3koc]<span class="syntaxdefault">
    import*java</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">awt</span><span class="syntaxkeyword">.*;
    </span><span class="syntaxdefault">import*java</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">io</span><span class="syntaxkeyword">.*;

    public*class*</span><span class="syntaxdefault">ARead</span><span class="syntaxkeyword">{
    public*</span><span class="syntaxdefault">void*f1</span><span class="syntaxkeyword">(){
    ********</span><span class="syntaxdefault">FileReader*fr</span><span class="syntaxkeyword">=*new*</span><span class="syntaxdefault">FileReader</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"C:/board_xy.txt"</span><span class="syntaxkeyword">);
    ********</span><span class="syntaxdefault">String*s</span><span class="syntaxkeyword">;
    ********</span><span class="syntaxdefault">Bufferedreader*br</span><span class="syntaxkeyword">=*new*</span><span class="syntaxdefault">BufferedReader</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">fr</span><span class="syntaxkeyword">);
    ********while((</span><span class="syntaxdefault">s</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">br</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">newLine</span><span class="syntaxkeyword">())!=*</span><span class="syntaxdefault">null</span><span class="syntaxkeyword">){
    ************</span><span class="syntaxdefault">System</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">out</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">println</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">s</span><span class="syntaxkeyword">);
    ********}
    ****}
    }

    public*class*</span><span class="syntaxdefault">AreadMain*</span><span class="syntaxkeyword">extends*</span><span class="syntaxdefault">ARead</span><span class="syntaxkeyword">{

    ****public*static*</span><span class="syntaxdefault">void*main</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">String*args</span><span class="syntaxkeyword">[]){
    ****</span><span class="syntaxdefault">ARead*a</span><span class="syntaxkeyword">;
    ****</span><span class="syntaxdefault">a</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">f1</span><span class="syntaxkeyword">();
    ****}
    }*</span><span class="syntaxdefault"></span>[/code:33xf3koc]

  7. #7
    Moderator coolpcguy's Avatar
    Join Date
    Mar 2007
    Location
    Bangalore
    Posts
    627
    Liked
    99 times
    Reputation points
    71

    Re: Urgent help in java

    Bufferedreader is not the same as BufferedReader.

    case sensitivity matters.


    Limitatation of Java: Class names should have the save corresponding file names. Class ARead should be present in file ARead.java ( more: http://stackoverflow.com/questions/5728 ... -myclass-j )
    Moderator at Super User, Web Apps Stack Exchange|Gamer|Drunk Coder|Music Lover|Maniac twitterer|Personal Blog|About Me
    Gadgets - HP Envy 14 / i5 520M / 8 GB / 128GB SSD / 1TB Seagate GoFlex | D-Link DGL 4500 | Denon AH-C360| Klipsch S4a| Fiio E5 | Samsung Galaxy SII | Dell U2312HM

    My Gear :HP Envy 14 / i5 520M / 8GB / 500GB HDD / 1TB Seagate GoFlex | Google Cr-48 | D-Link DGL 4500 | Denon AH-C360| Klipsch Image S4a | Fiio E5 | iPhone 3GS| Galaxy S II | Dell U2312HM| X-tatic 5.1 Gaming Headset | Logitech G400 Optical Mouse

  8. #8
    Uber Newbie
    Join Date
    Oct 2007
    Location
    shivamogga
    Posts
    20
    Liked
    0 times
    Reputation points
    0

    Re: Urgent help in java

    I did the changes as you told me but it still giving some errors- it says that it cannot find the symbol and then it points to FileReader in the program all over.
    So what should i do now ?

  9. #9
    Uber Newbie
    Join Date
    Oct 2007
    Location
    shivamogga
    Posts
    20
    Liked
    0 times
    Reputation points
    0

    Re: Urgent help in java

    same for BufferedReader. I changed it and now i corrected it to BufferedReader everywhere

  10. #10
    Uber Newbie
    Join Date
    Oct 2007
    Location
    shivamogga
    Posts
    20
    Liked
    0 times
    Reputation points
    0

    Re: Urgent help in java

    Hey I got it. I just had to include the import statements in both the java files and add exception's try catch blocks.
    Now it's working fine. thanks guys

Similar Threads

  1. Replies: 0
    Last Post: 11-21-2011, 12:58 PM
  2. graphic card
    By padmu_123 in forum PC Hardware
    Replies: 1
    Last Post: 11-13-2006, 07:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •