This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 4531
    
    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: 19684
    
  20

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
 
jQuery in Action, 2nd edition
 
subject: not showing JLabel and TextField