File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not showing JLabel and TextField

 
numan ahmad
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
numan ahmad
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic