• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Jpanel with null border layout  RSS feed

 
nand rai
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Friends i have a applet which has a jpanel with lay out as null. and I also have Jlist for multiple selection with in the jpanel.

My question is i could not able to resize my j panel. how can i do that.


my objective is to increse the size of Jlist so that it will show at least 15 entries at minimum.

Thanks

Layout was null
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confused. Either the layout manager is BorderLayout or it's null, but it can't be both. Perhaps you can clarify and post some code?
 
Mikko Kohtamäki
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you set component layout to null then you use 'free positioning' with help of setBounds(x, y, width, height)

and setLocation(x, y) and setSize(width, height)
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> my objective is to increse the size of Jlist so that it will show at least 15 entries at minimum

if you were using a layoutManager, it would be simply
list.setVisibleRowCount(15);

but for null, you'll have to calculate the size of everything (including the scrollpane)
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!