This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

null layout issue..........  RSS feed

 
Akshay Kumar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i've an applet and i'm adding AWT ScrollPane to it. now, i'm adding individual panels (as records) into a new AWT Panel(which is null layout) and placing this AWT Panel in AWT ScrollPane.

the individual panels getting added vertically but when i resize the applet, all the individual panels(as records) laid out horizontally and so, obviously, only the horizontal bar is alone visible. instead i need it in vertical order only.

how to overcome this issue?
 
clio katz
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you tried making the root panel BoxLayout on Y_AXIS?

Here's an example (lists all the fonts on your system):




NOTE: code runs faster if you embed Label rather
than Panel in the main panel... if you are
worried about performance
eg
// pnlMain.add(new Label(fontNames[i]));
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!