This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem with Jpanel with null border layout

 
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
 
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?
 
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)
 
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)
 
Have you no shame? Have you no decency? Have you no tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic