Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Swing-AWT How can i select a particular item in jpopup menu through java programs
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


shackir puluckool
How can i select a particular item in jpopup menu through java programs
3 Answer(s)      3 years and a month ago
Posted in : Swing AWT


Good day Friends ....

I have a doubt in jpopupmenu. That how can i sow a perticular menu item in jpopup menu to be selected. I created a gui where it has 1 textfield.when this text field get focus. then a popup menu will appear with 5 menu item in it. assume that the user pressing down key 3 times. I need to show the 3rd item get selected.

I used MenuItems as elements in jpopup menu. If u have any suggestions otherthan any of these like use jlist instead of jpopup menu. Then please send me an example with code.

Some one please help me.

thanks in advance....


Advertisement
View Answers

September 15, 2011 at 12:32 PM


Please visit the following link:

Create PopUpMenu in Java Swing



September 15, 2011 at 1:16 PM


Thanks dude...

I didnt get the exact answr for my question.

The link is describing about the basics of jPopUpMenu. But i need to select 3rd item through my program. Here it is selecting 1st has default.

there is any method like

JPopupMenu jpm=new JPopupMenu();

and 5 'JMenuItem menuItem1 = new JMenuItem("1"); ' jpm.getselected(); or similar method which will help us to select any 1 menu item from menu

Please help me friends....

Thanks in advance friends....



September 15, 2011 at 1:16 PM


Thanks dude...

I didnt get the exact answr for my question.

The link is describing about the basics of jPopUpMenu. But i need to select 3rd item through my program. Here it is selecting 1st has default.

there is any method like

JPopupMenu jpm=new JPopupMenu();

and 5 'JMenuItem menuItem1 = new JMenuItem("1"); ' jpm.getselected(); or similar method which will help us to select any 1 menu item from menu

Please help me friends....

Thanks in advance friends....



Related Tutorials/Questions & Answers:
How can i select a particular item in jpopup menu through java programs
How can i select a particular item in jpopup menu through java programs ... a perticular menu item in jpopup menu to be selected. I created a gui where it has... the 3rd item get selected. I used MenuItems as elements in jpopup menu. If u
how can i close particular frame in swings - Java Beginners
how can i close particular frame in swings  Hi, I want to know, how can we close a particular frame when mulitple frames are appearing as output... in swings and three frames are having their own close buttons and when i click
Advertisements
i am getting an error in adding a menu item to a menu.
i am getting an error in adding a menu item to a menu.   i am not able to execute the menu program. i am getting an error at menu.add(menuitem... to add a menu item to a menu. can anyone help me
How can java programs execute automatically when it connects to network
How can java programs execute automatically when it connects to network  Good Day dears... How can java programs execute automatically when it connects to network. Thanks in Advance friends Shackir   How can i Test
how can i send a mail to a particular user from a many user dropdown list in jsp
how can i send a mail to a particular user from a many user dropdown list in jsp  how can i a sent a user question to a particular person from a drop down list in jsp
how we can create website through java
how we can create website through java  Dear actually i wanna ask query about creation of website through java then how we can create web site through java plz help me..........i have already a web site ....specially for premium
How can I learn Java?
How can I learn Java?  Hi, I have just completed a course in HTML.... Now I want to learn Learn Java programming and become the expert in Java programming. How can I learn Java? in shortest possible time. I mean I just want to begin
highlight menu item html
highlight menu item html  highlight menu item in html or CSS   <body id="index"> <div id="menu"> <ul> <li class...; </ul> </div> <!-- menu --> </body>
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.  I am using postgresql-8.4.4-1... netbeans-6.1-ml-windows.How can I set up connection to database? Please help me
how I do select from select in hql
how I do select from select in hql  select RN from ( select rownum RN, dbid from ( select * from profile p where type = 1912 and name like... doesn't work select RN from ( select rownum RN, DBId from ( select distinct p
how to execuite java programs???
how to execuite java programs???  I have jdk 1.6 installed in my pc.i want to execuite java programs in ms-dos for applet and without using applet.please tell me
how to execuite java programs???
how to execuite java programs???  I have jdk 1.6 installed in my pc.i want to execuite java programs in ms-dos for applet and without using applet.please tell me
How can I paginate a table which has shown in a div through Ajax in client side without using database
How can I paginate a table which has shown in a div through Ajax in client side without using database   The table is shown by calculation in a PHP script file so The data not store any where so please give me the way to paginate
how can i close a frame. - Java Beginners
how can i close a frame.  Hi, My question is how can we close... frames as i go on clicking button...........can we have like when i click on button...............my target is when i click on that button, a new frame is coming and updated table
how can i simplify my java code
how can i simplify my java code  /* Create a program that prompts... c=0;int f=0;int i=0; int counter=0; int starter=0; int cot=1...)(Math.random() * 9 +cot); h = (int)(Math.random() * 9 +counter); i = (int
Menu Control in Flex4
a submenu. You can select a indivisual item from menu control. You use only Actionscript for create a pop-up Menu control. There is no MXMl tag. You can...:Application> In this example you can see how we can use a Menu
how to select random rows from database through servlet
how to select random rows from database through servlet  hello i want to know, how to select random rows from database through servlet
How can i download these java related materials from rose india
How can i download these java related materials from rose india  How can i download these java related materials from rose india   Hello... through it. We have provided download option to all our examples. Anyways, which
How we can create a table through procedure ?
How we can create a table through procedure ?  How we can create a table through procedure
how can i achieve multiple inheritance in java without using inheritance ?
how can i achieve multiple inheritance in java without using inheritance ?  how can i achieve multiple inheritance in java without using inheritance
Dojo Menu and Menu Item
Dojo Menu and Menu Item          In this section, you will learn about the menu and how to create it in dojo. Try Online: Menu and Menu Item Menu : This is the widget models
How i can send testing mail on my id using java?
How i can send testing mail on my id using java?  Which packages i should use to implementing java mail service??? Thanks
How can i read a file from nth line onwards in java
How can i read a file from nth line onwards in java  Hi, I need to read a file content from its nth line onwards till end. How can i implement it in java. Regards, Chinnu
select one item name throug combo box than other combobox show item price
select one item name throug combo box than other combobox show item price  i have one table in database item master..if i select one item name through combo box than other combobox show item price only select item name... how i
How can i draw a line using java swings
How can i draw a line using java swings  Sir my program contains different components i am using JFrame. I want to draw a straight line between components(Jtextfeilds, Jlabels).So could you help me for it. Thank You
How can i draw a line using java swings
How can i draw a line using java swings  Sir my program contains different components i am using JFrame. I want to draw a straight line between components(Jtextfeilds, Jlabels).So could you help me for it. Thank You
how can i draw a table using applet or swings - Java Beginners
how can i draw a table using applet or swings  Hi RoseIndia, Actually, I was trying for creating a table using applet or swings.......... My task... to enter integer values..........but the examples i have gone through are accepting
how can i make a session invalidate in java when browser is closed
how can i make a session invalidate in java when browser is closed   how can i make a session invalidate in java when browser is closed   ... same userid can not login at multiple browsers/machines. if any user is using
How I can Set Transparent Background Image to Panel - Java Beginners
How I can Set Transparent Background Image to Panel  Sir ,How I can Set Transperent Background Image to Jpanel. plz Help Me
How can i write a datagrid coding - Java Beginners
How can i write a datagrid coding  Hi, I want make a datagrid..plz send me datagrid coding using mysql database and jsp..plz tell me brief description about grid how can i connect datagrid with database. Thanks
how can i create a data grid - Java Beginners
how can i create a data grid  Nice to ur respose...thnks all of u plz help me i want make a datagrid but i have no idea about this how can i create datagrid. and how can i connect to the database plz help me give
 

 

 

DMCA.com