• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why is my UI broken?  RSS feed

 
Jim Venolia
Ranch Hand
Posts: 248
2
Chrome Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to display some stuff on top, then an area that will hold a graph. I seem to be missing something fundamental, I just don't know why this doesn't work.

 
Greg Charles
Sheriff
Posts: 3014
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In what way doesn't it work? It doesn't compile, it has a run time error, or just nothing shows up on the screen?

I'm suspicious of your setting a null layout to UI. Why are you doing that?
 
Jim Venolia
Ranch Hand
Posts: 248
2
Chrome Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Holy crap, you solved half the problem. I was setting it to null as I'm following examples found on the web, and trying to convert working examples into the code I need.

Commenting out the setLayout(null) showed my basic UI, but I still don't see my main board. But I'm no longer stuck in the "what am I missing?" mode.

The posted code compiles fine, just doesn't produce the expected output. I want a UI as the top row, followed by a graph that's the rest of the UI.

Doing Conway's Life. The Life part works fine, I'm just trying to slap a GUI over it.

Thanks!
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to choose a proper layout and add the components. Recommended reading http://docs.oracle.com/javase/tutorial/uiswing/layout/using.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!