• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

JPopUPmenu Problem of PopUp scroll

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic