File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPopUPmenu Problem of PopUp scroll

 
vinaya kumar
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 508
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>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
Posts: 508
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 508
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see here for the sample code of a TreeCombo:
http://www.eos.dk/pipermail/advanced-swing/2002-May/001275.html
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic