aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes not showing JLabel and TextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "not showing JLabel and TextField" Watch "not showing JLabel and TextField" New topic
Author

not showing JLabel and TextField

numan ahmad
Ranch Hand

Joined: Jan 27, 2011
Posts: 49
hi to all...
i am new in java and try to learn awing....The program that i made is not showing me any TextField and JLabel ...



i also have made a Main class to run it....
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Please review Christophe Verré's response on your your earlier thread.

There's a lot wrong here. One,your class extends JFrame but also constructs a JFrame f, which is never used. Then, there's a setVisible(true) before any components are added. And since JFrame has a default BorderLayout, and you add 10 components without any constraints, only the last of these will be managed by the layout manager.

I suggest you go through the Swing tutorial trail, doing all the exercises as you go along. There's really no substitute for learning how to do things correctly.


luck, db
There are no new questions, but there may be new answers.
numan ahmad
Ranch Hand

Joined: Jan 27, 2011
Posts: 49
thank you very much sir

i make a database and also define a interface to retrieve data from database...i created four button out these four button only one button is working and reaming are not.....when i click on these button and receive a message on cmd which is like that...

java.sql.SQlException Result set type is TYPE_FOREWORD_ONLY



i did not getting it please tell me about that?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19552
    
  16

Please create a new thread in our JDBC forum for that problem. It's not GUI related, and a related but still different problem from the one this thread is about.

But the reason is simple: by default you can only go forward in ResultSets. The (Prepared)Statement must be created using one of the other types (TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not showing JLabel and TextField
 
Similar Threads
Calculator Problem
Can't Update Record ?
Adding Record Problem in JDBC ?
JDBC - Applet - Swing
Can't Update Record ?