|
-
JComboBox??
Having recently found and implemented JComboBox in my code, I cant seem to find anywhere that will help me with the action or itemlistener. What I want to do is set certain TextFields to "uneditable" if "NO" in my drop down menu in my ComboBox is selected...and editable if "YES" in the ComboBox is selected. I dont know if to use itemlisteneres or actionlisteners. Ive tried both and failed miserablly both times. Can someone help?
Here is the specific part of the code:
String [] pp = {"NO", "YES"};
jcbppayment = new JComboBox(pp);
jcbppayment.addItemListener(this);
jcbppayment.addActionListener(this);
jtfamount = new JTextField();
jtfswpayment = new JTextField();
jtfamount.setEditable(false);
jtfswpayment.setEditable(false);
...
public void actionPerformed(ActionEvent e) {
}
...
public void itemStateChanged(ItemEvent ie){
}
Similar Threads
-
Replies: 1
Last Post: 11-12-2007, 02:33 AM
-
Replies: 7
Last Post: 10-10-2007, 08:21 PM
-
Replies: 3
Last Post: 10-03-2005, 12:27 PM
-
By JavaMixin in forum Java
Replies: 3
Last Post: 09-02-2005, 01:59 AM
-
Replies: 1
Last Post: 08-01-2002, 10:48 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks