actionlistener

Updating text on JFrame depending on ActionListener

This is a result of ActionListener. Depending on what he chooses in the Combo Box it returns a price. I just want it as a simple $39.99. Nothing more. I have the packageIndex = packageChoice.getSelectedIndex(); All the prices are in an array: String[] prices = {"49.99, 39.99, 34.99, 99.99"} Now I need to know how to pull the pr...

ActionListener Event Handling

Coded for a checkbox that agrees to the Terms of Service and an accept and decline button. I need help for an exception handling that if the user does NOT have the checkbox as SELECTED then when they hit accept, an error message occurs telling the user that he has not selected the checkbox. How would I code an error handling except...

JFrame not working correctly

This is making me very angry, I have worked on this for 2 days, have 2 books open and have looked through them, and STILL can't get this program to run the way I want it run. I'm getting to the point where if this doesn't help, I quit. I want a SIMPLE Frame application. It has a JComboBox centered at the top. Next to it is a text field...

Re-populating a JList on an ActionListener event

Depending on what they choose in the JComboBox I want the JList to show different strings, not sure how to repopulate a JList though. When searching through the API, still found nothing. Any idea on how you might code this? Im using NetBeans by the way for reference. ...

My Devexpress Gridview Delete event is firing multiple times

I have a Devexpress Gridview that is linked to a delete, fetch and update stored procedure. The problem I am having is that when I run my program, select a row in the grid and press delete it fires the event multiple times. Specifically it deletes the selected row and then I re-fetch the data so the focus returns to the first row. Which ...

Java action listener question

I am creating a custom JPanel element (a login form). I want to allow people who use my panel to subscribe/listen to an event called "loginSuccessful". What is the best way to implement this in my JPanel object? UPDATE: oh and i also want to add that when that action is triggered, i also want to return a "User" object containing the ...

actionlistener returning a nullexception on jbutton

I have an action listener set up on my main jframe menu for the buttons listed on it, and they work fine, bringing up other jframes as needed. The problem is when a person clicks the buttons on the jframes brought up I get a nullexception after a jbutton is clicked on that submenu jframe. Example code: public class main extends JFrame...

GUI in java, private classes for listener not working

Hello, I am trying to make a GUI in Java, using something along these lines: public class GUIApp { DrawingPanel dp; buttonPanel bp; ova = Oval; public GUIApp() { JFrame win = new JFrame("Drawing App"); dp = new DrawingPanel(); bp = new buttonPanel(this); //Settings for panels and frame ...

Jsf ActionListener for custom security implementation

I've developed custom ActionListener: public class SecureActionListener extends ActionListenerImpl implements ActionListener { private ActionListener _delegate; public SecureActionListener(ActionListener delegate) { _delegate = delegate; } @Override public void processAction(ActionEvent actionEvent) { ...

JSF 1.2 difference between exception in action and actionListener

I've noticed that JSF 1.2. does not return error page when an exception was thrown in actionListener method but does return error page when an exception was thrown in action method. Why is that? Can it return error page in both cases? ...

Workaround for adding ActionListener to JTextArea

I have a program that get's input string with file path in one JTextArea and then loads it's content to a second JTextArea. Problem is that when using JTextArea I cannot add an actionListener that will load content in the second JTextArea when leaving this field. How to get around this problem ? protected JTextArea inputField, outputFie...

Differences between action and actionListener

What is the difference between action and actionListener. When sould I use action and/or actionListener? My question is related JSF 2.0. ...

Calling variables using arryes to change in JLabel after an action

hi guys, i'm having small problems in calling variables and changing the variables after the user hit the change button. i'm new here trying to learn Jave , hope you can help. import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class NestedPanelsTwo { private J...

Pass request parameters through FacesContext

Hi! I moved from JSF 1.2 to JSF 2.0 and it seems I missed something during the switch. I have following scenario: There is a button on one page with actionListener set to one managed bean's method which adds an object to request by calling FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put("foo", fooObject); Na...

adding an action listener to a JComboBox

I just want to print the selected option in the combo box, to a textfield. Please explain what's wrong because i have to complete it & explain it in class. Any help would be greatly appreciated. Thanks in advance. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class App3 extends JFrame implements ActionListen...