473,441 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,441 software developers and data experts.

java Gui actionListener help

I'm trying to write a java gui program that contains 3 different tabbed pane, 1 tabbed pane consists JComboBox. When i choice using JComboBox, the result will be shown because I using actionListener to create JComboBox result. What i want to do is when I choice JComboBox in one of tabbed pane, it would also show result in another tabbed pane as I have 3 tabbed pane in my program. I've been trying all the ways i know but i can't write it. Please help me out from this ... Thanks you very much .



String [] quantity = {"0","1","2","3","4","5"};
com1 = new JComboBox (quantity);
com1.setSelectedIndex(0);
com1.addActionListener(new listener());
add (new JLabel ("choice"));
add (com1);


private class listener implements ActionListener

{
public void actionPerformed (ActionEvent event)
{

int totalIdx = com1.getSelectedIndex();

if (totalIdx >=0)
label.setText("Total : " + total3[totalIdx]);
May 18 '10 #1
0 2200

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Fred | last post by:
I need to recreate the following formula in java: INT((A2^3 + B2^3) / 100)) + MOD((A2^3 + B2^2), 100) Can someone show me how to do this in java? -Thanks
13
by: Andrew Bell | last post by:
I'm doing a uni course in the UK and one of my semesters is about programming. This is just going to be compilied and executed with no menu just using command promt (javac classfile.class) I am...
3
by: yoyojava | last post by:
here go to this link: http://staff.beaumont.k12.tx.us/jchauvi/CS2/CS2.html ..... then click on PROJECT:Bruin Grocery ... and i am done with everything except for step 5 and 6 the search methods.. i...
2
by: rookiejavadude | last post by:
I'm have most of my java script done but can not figure out how to add a few buttons. I need to add a delete and add buttong to my existing java program. Not sure were to add it on how. Can anyone...
11
by: saytri | last post by:
I have made this piece of code where the output should display a dialogue box asking for a password. Then if the user enters it correctly it displays "Valid" or else it displays "Not Valid". However...
1
by: mshroom12 | last post by:
Hello to all. I am having difficulty trying to do this Java project using Eclipse. The following is what I have to do. Election Day It's almost election day and the election officials need a...
4
Stubert
by: Stubert | last post by:
Hi there just a quick question, if I have multiple JMenuItems do I need to create an inner class ActionListener for each and every JMenuItem I create? Or is there a more efficient way of doing it? ...
2
by: sunsom | last post by:
hi all, i have a requirement to send FAX through java code. how can i do a fax in java..kindly help!!!. what API is there for FAX....(free API).
2
by: yeshello54 | last post by:
so here is my problem...in a contact manager i am trying to complete i have ran into an error..we have lots of code because we have some from class which we can use...anyways i keep getting an error...
1
by: danielmessick | last post by:
In my following program, how do I have numbers entered into the TextArea that when I click the JButton the numbers add up and are displayed in the TextField above the JButton ??? import...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.