I tried to set it as unfocusable but it didn't help,got any other ideas?
Type: Posts; User: SagiIs
I tried to set it as unfocusable but it didn't help,got any other ideas?
I thought it was about focus as well,do you know how to set as unfocusable?
Hi,I got an application that contains buttons that when pressed,draw a figure.For example,if the "triangle" buttons is pressed then a triangle is drawn.I tried to add controls so that the figure that...
Actually I did,I already showed you the code,I do use a panel for the buttons and a drawing area.
I actually ran the code before,my problem is running that code with the buttons.
I see,thanks a lot man you helped me a lot
I added what you said and now it works but it is opened in a separate window,I need it to work in the window which contains the buttons.
I did it in the MovePingPong class.
I don't understand,I thought I did it as well.
Does the changed class look like this?
import java.awt.Color;
import java.awt.Graphics;
import java.util.Timer;
import java.util.TimerTask;...
I changed the drawPingPong method to an Override paint method.The method is entered when compiled but the same affect,the screen is only updated when the button is pressed again,the repaint() does...
Isn't that exactly what I did in MovePingPong class?
I don't override any paint methods because my drawing method is in a Panel class.If repaint() only works with the overrided paint method then what should I do to update the screen and create an...
There are classes I use here which I didn't think that are relevant.
Picture:
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Panel;
The code for the class with the buttons:
import java.awt.*;
import java.awt.event.*;
import java.util.Timer;
import java.util.TimerTask;
import java.awt.event.KeyEvent;
import...
Is it really relevant?I thought the Frames are a way to define the window.
I do have a listener for my buttons which is built like a class.
My code:
import java.awt.*;
import java.awt.event.*;
import java.util.Timer;
import java.util.TimerTask;
import...
What listener are you referring to?
I'm not that advanced with java so could you please explain some of your used terms?what is JVM,what is the GUI's control?
Hi!
I have a java application with multiple buttons.When pressed,every button shows a different painting.One of the button is supposed to display a moving ball.The problem is,the repinat() event...