String « Event « Java Swing Q&A





1. String Action    coderanch.com

Where is this String? If it is painted in a Panel or Canvas, you simply need to add a MouseListener to the Canvas or Panel, and capture MouseEvents which occur within the co-ordinates of the String. If this String is in a List, combo box, etc., different actions are already prescribed for these components when something in them is chosen. If ...

2. Passing a String from a called objects ActionListener back to the original calling object.    coderanch.com

So you are talking about passing a String from an actionPerformed method back to the calling object? If you can't figure out a way to actually "pass" the string back to the caller, then there should be a way to have the actionPerformed method jut set a variable, and have the calling object "retrieve" the value.

3. returning String from ActionPerformed    coderanch.com

Hi all, I know this king of issue is quite common but I'm brand new in java so I found clues about my problem but didn't manage to make it works. Basically, I'm trying to build a small image processing program in which you load an image and then do simple stuff like rotating, changing colors, etc.... So far (which is ...

4. Help with drawing a string using mouse events    java-forums.org

import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; public class adventure extends JFrame implements MouseListener { String message = " "; public adventure() { setSize(500,500); setVisible(true); show(); addMouseListener(this); } public void mouseClicked(MouseEvent e) { int x = e.getX(), y = e.getY(); message="Click"; repaint(); } public void mouseExited(MouseEvent e) {} public void mouseEntered(MouseEvent e) {} public void mouseReleased(MouseEvent e) {} ...

5. returning String from ActionPerformed    java-forums.org

Hi all, I know this king of issue is quite common but I'm brand new in java so I found clues about my problem but didn't manage to make it works. Basically, I'm trying to build a small image processing program in which you load an image and then do simple stuff like rotating, changing colors, etc.... So far (which is ...