| | |
Help! using separate classes for JFrames
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2004
Posts: 1
Reputation:
Solved Threads: 0
Hello there. Can anybody help me with this problem.
I am trying to write a program that creates instances of classes that extend JFrame to make my application windows....
This code runs but I can not reference the JTextField shown on the GUI - it seems that there is another instance of it created somehow that is used - to see what I mean run the attatched code, and click connect. The text in the userName text box is not displayed on System.out.....
Any ideas????
Thanks Matthew Deaves
I am trying to write a program that creates instances of classes that extend JFrame to make my application windows....
This code runs but I can not reference the JTextField shown on the GUI - it seems that there is another instance of it created somehow that is used - to see what I mean run the attatched code, and click connect. The text in the userName text box is not displayed on System.out.....
Any ideas????
Thanks Matthew Deaves
hmmm...
I don't have Java installed on this computer, so I can't run your program... but the static method you are calling returns a boolean value, so this ActionListener bit should be something like...
Boolean x = loginUser(userName.getText()); (to get said method to run, and to accept the returned boolean value)
if that doesn't work... then try
Boolean x = DocumentClient.loginUser(DocumentClient.userName.getText());
•
•
•
•
if (e.getSource() == connect){
//THIS DOES NOT THROW THE VALUE OF userName TO loginUser()??????
loginUser(userName.getText());
}
Boolean x = loginUser(userName.getText()); (to get said method to run, and to accept the returned boolean value)
if that doesn't work... then try
Boolean x = DocumentClient.loginUser(DocumentClient.userName.getText());
![]() |
Similar Threads
- Selection Sort in java (Java)
- Clarification in Classes (C++)
- Interface File and Multiple Classes (C++)
- Determining classes. (Computer Science)
- (C++) Writing a Copy Constructor?!? (C++)
- How to "delete" this memory??? (C++)
Other Threads in the Java Forum
- Previous Thread: Virgin programmer
- Next Thread: Text breakage when panel is resized
Views: 1997 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application arguments array arrays automation bidirectional binary birt bluetooth calculator chat class classes client code columns component database designadrawingapplicationusingjavajslider detection draw eclipse editor error errors event exception expand file fractal game givemetehcodez graphics gui guidancer helpwithhomework html ide image inetaddress input integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jme jmf jni jpanel julia linux list loop map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie number object oracle os plazmic print problem program programming project recursion scanner screen server set signing size smart sms smsspam socket sort sql string subclass support swing test threads time transfer tree windows





