• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to control JList's size ?

 
jack morton
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,
I'm trying to create JTextFiled with autocomplete option using JList,
How to be sure when JList is displayed it's dimension doesn't exist Window's border ?
Thank
 
jack morton
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for mistake
How to be sure when JList is displayed it's dimension doesn't exist Window's border ?
 
jack morton
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for mistake :�
How to be sure when JList is displayed it's dimension doesn't exceed Window's border ?
 
Brian Cole
Author
Ranch Hand
Posts: 920
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jack morton:
How to be sure when JList is displayed it's dimension doesn't exceed Window's border ?


Unless you are using the null layout manager, then JList will not exceed the Window's border. It's as simple as that. If you are actually having trouble with this, perhaps you should show us a small code example that exhibits the problem.

btw, if you want to correct a posting you can use the pencil-and-paper icon to edit an entry in place.
 
jack morton
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a popup dialog containing JPanel with GridBagLayout for displaying JList,Is there a mean to have the popup dialog doesn't exceed the main window ?

Originally posted by Brian Cole:

btw, if you want to correct a posting you can use the pencil-and-paper icon to edit an entry in place.


 
Brian Cole
Author
Ranch Hand
Posts: 920
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jack morton:
I'm using a popup dialog containing JPanel with GridBagLayout for displaying JList,Is there a mean to have the popup dialog doesn't exceed the main window ?


Are you placing the JList in a JScrollPane (and then the scroll pane in the dialog)? If not, you probably should, as it will probably solve your problem. (If it doesn't check out JTable's setPreferredScrollableViewportSize method.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!