Event « Text Input « Java Swing Q&A





1. Getting an action after text is pasted into a JTextComponent (Java)    stackoverflow.com

This really puzzles me. I have a JTextComponent for which I've added a right-click cut\copy\paste menu using a JPopupMenu and DefaultEditorKit.Cut\Copy\PasteAction().

JMenuItem cutItem = new JMenuItem(new DefaultEditorKit.CutAction());
JMenuItem copyItem = new JMenuItem(new ...

2. What is the "good way" to subscribe to value changes in a JFormattedTextField?    stackoverflow.com

I want to subscribe to value changes on a JFormattedTextField. Checking the source code, the only thing I see is that the property "value" is fired on a new value. But ...

3. javax.swing.JFrame setText() in a loop? + intentional delay?    stackoverflow.com

I am very new to Java (only been using it for about a week) and I'm working on a store simulator. Basically I just want to get basic things done right ...

4. Gui Editor - ActionPerformed Methods in own class?    forums.netbeans.org

Hello, I'm using the NB Form Editor. Is it possible to move the created ActionPerformed() Methods to it's own class or so? By default, all of them are placed in same class of generated code with initComponents() and so on. But it get's confusing somehow if a lot more Performed Methods are created. As I cannot move them (code locked due ...

6. JLabel setText not working in actionListener    coderanch.com

I did some research and was able to solve my problem. Hopefully it'll help those who might run into the same problem. Apparently, Swing component repainting is managed by a RepaintManager class which intercepts all paint requests and calls invokeLater() to process the pending requests on the same dispatch thread. Therefore you have no control over exactly when the repainting occurs. ...

7. Making textTextField's and JPasswordField's Visible on Event    java-forums.org

I have come across what seems like it should be a trivial problem in my project: I have set some of my fields on my GUI to invisible (with .setVisible(false);) in post-creation code. When I run the GUI the items are indeed invisible but when I click on my button which has myTextField.setVisible(true); nothing happens. I can get the button to ...

8. jlabel.setText not working event from another class    forums.oracle.com

"First of all, use code formatting " i dont know where is it. and also i already explain what im trying to do maybe you did not read the comments of my code and the message bellow my last code. i already explain my problem. im trying to update the text of label using label.setText from myPanel.java using stateChanged of tabPane ...