473,469 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

java Gui actionListener help

1 New Member
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 2201

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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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
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: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.