wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JPopUPmenu Problem of  PopUp scroll Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPopUPmenu Problem of  PopUp scroll " Watch "JPopUPmenu Problem of  PopUp scroll " New topic
Author

JPopUPmenu Problem of PopUp scroll

vinaya kumar
Ranch Hand

Joined: Jan 20, 2002
Posts: 70
I am assumming that the textfield is at
the bottom of the screen.
I have a JPopMenu. which is displayed when a text field is pressed
If the menu contains morethan 10 items,(basically popmenu goes beyond the screen),then Popup dispalys 10 and then scrolling is not done..
should have to do something so that PopUp scroll happens..
thanks and Regards
vinaya
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
this is not really an answer to your question, I just wondered:
why is there a popup on the textfield - has the user to choose some value that is then automatically entered in the textfield? if this is the case you should use an editable JComboBox.
vinaya kumar
Ranch Hand

Joined: Jan 20, 2002
Posts: 70
>>this is not really an answer to your question, >>I just wondered:
>>why is there a popup on the textfield - has the >>user to choose some value that is then >>automatically entered in the textfield? if this >>is the case you should use an editable >>JComboBox.
Okee..! well the user has to chose from a set of
existing values which is decided only at th instances he clicks the text box.
okee! how do i do this wrt to editable JComboBox..
and also , my problem of popmenu still exists.
if i use the same for celleditor (JTextfield) which will put the value to cell based on the click in the pop up menu,i face this incomplete pop menu... problem..
hope i am clear
Thanks for ur help
vinaya
.
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
you don't need popup menues for cell editors neither. popup menues are there to jump to another point in the program, to start another action. they are not meant as editors for any textfields.
you create an editable JComboBox by:

if you want the data of the combo box to change dynamically you should use a custom ComboBoxModel (ListModel). see the Swing tutorial!
In case of a cell editor for JTable: this will be an editable JComboBox as well. you need to implement a TableCellEditor that is a subclass from JComboBox (the DefaultEditor extends JTextField). See the Swing tutorial on JTable and TableCellEditor!
cheers
vinaya kumar
Ranch Hand

Joined: Jan 20, 2002
Posts: 70
Thanks !
oops!!! Sorry,
I just missed one more point in that..
which was why i used Popup for the CellEditor
instead of ComboBox
for a value in combobox i was not able to have submenus( I think we should use combotree, ,but did not any apis is jdk1.3).
Hence i moved to PopUps
Hope i am clear with my problem..
Thanks a lot again for ur inputs
Regards
vinaya
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
see here for the sample code of a TreeCombo:
http://www.eos.dk/pipermail/advanced-swing/2002-May/001275.html
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JPopUPmenu Problem of PopUp scroll
 
Similar Threads
JComboBox
combo popup out of screen problem.
DataTable Scroll bar Position Changing
JS bookmarklet to open window, scrollto, and hide all toolbars
Scrollable JPopupmenu