Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why does this Swing program doesn't show anything?  RSS feed

 
Andreas Balzer
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is the JFrame empty? See http://pastebin.com/m6ae1dc8b

Thanks for help.

Greetings,
Andreas
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You haven't set a layout. Try the diff I added to the code.
 
Andreas Balzer
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thanks so far. Unfortunately I get
MeterToInch.java:25:35: cannot find symbol
symbol : class GridLayout
location: class MeterToInch
pane.setLayout(new GridLayout(4,1));

What to do?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm fairly certain there's only a single class of that name in the class libraries; I think it's in java.awt.
 
Andreas Balzer
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks. I should have been clever enough to find that out but somehow I'm currently a little bit blind :-/

So thank you very much!
Btw: If you know about SWT too: I have 2 threads opened in the last couple of minutes where I need help as well

Andreas
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!