6 Topics

Member Avatar for
Member Avatar for Stefce

Hello i have a little problem over here im trying to make a mouse listener and on mouse click the ball to come to the mouse pointer... i have maked a small "game" which is not bunch of confusing code... i have maked the ball to be controlled by the …

Member Avatar for Stefce
0
2K
Member Avatar for makehaste

Per the title, I'm trying to figure out a way to restrict the boundaries of mouseClicked. I have an image that moves across the screen. When I click on it, it alternates with another image. However, I only want it to alternate when I click within 30 pixels of its …

Member Avatar for mKorbel
0
139
Member Avatar for 65piano

First of all, I'm new to GUI so I may have made some terrible mistakes.. right, so I have a two dimensional array of buttons and I need to identify which button in the array is clicked, hovered over, and hovered off. For now I just want my program to …

Member Avatar for JamesCherrill
0
187
Member Avatar for NickJoe

Hello, I've looked all over the web and can't seem to find how to do this, so I'll try here. I'm working in a program in which i need to draw shapes, specifically irregular polygons. I figured the easiest way to do this, and the one that makes the most …

Member Avatar for JamesCherrill
0
267
Member Avatar for ztini

I'm having some fundamental issues with some basic abstraction. Here is the super class: [CODE] public abstract class Tile extends JLabel implements MouseListener { public Tile() { setIcon(new ImageIcon(getClass().getResource("images/blank.gif"))); } @Override public void mousePressed(MouseEvent e) { System.out.println("clicked"); switch(e.getModifiers()) { case InputEvent.BUTTON1_MASK: leftClick(); break; case InputEvent.BUTTON2_MASK: rightClick(); break; } } public …

Member Avatar for ztini
0
184
Member Avatar for mangopearapples

I'm trying to make it so when I press ESC, it RestoreScreen() but it doesn't work. Now I don't know whether it's my method RestoreScreen() or my listeners. This is my code: [code]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class main extends JFrame implements MouseListener,KeyListener{ public void keyPressed(KeyEvent e) { …

Member Avatar for roxin_phoenix
0
183

The End.