public void buttons(){
int c = WHEN_IN_FOCUSED_WINDOW;
Action right = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
player.setVX(2);
}
};...
Type: Posts; User: poldz123
public void buttons(){
int c = WHEN_IN_FOCUSED_WINDOW;
Action right = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
player.setVX(2);
}
};...
import java.awt.BorderLayout;
import java.awt.Image;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
Thank you very much now it is working. It is the paint method fault. now Im using the paintComponent method. that helps alot.
Hi why is that my background or other images that I paint hides my button??
17981799
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import...
why is that when I put the button on a while statement with other method such as the paint() and the fullscreen method with update.
public void gameLoop(){
long startTime =...
Why is that my button doesnt show to the screen BTW I am using a fullscreen instead of JFrame
public class optionButton extends JPanel{
public JButton shop;
public JButton exit;
public...
how can I click an image like a button..
so instead of using the JButton I am using an Image
how to delete a picture on the screen on a certain time with out pausing the program..
cause I used the try and catch with tread.sleep inside and while but it keeps pausing.
Is there a way to...
I already me a spacejet image that goies back and fourth using the KeyListener also it shoot one image at a time. thats the only thing I need to fixe for now. can you find me a link on a good example...
shooting ====>>> like space invaders it shoots laser with the same image and it moves
sample code ==>>> sample code for using the image as a shooting material that create a new image when the...
How do I use one image use it many times as I like.
like for shooting..
can someone give me a sample code for it
I think you need a scanner for each variables.
import java.util.Scanner;
public class loops {
public static void main(String[] args) {
int length;
int width;
int count = 0;
Scanner input = new Scanner (System.in);...
import java.util.Scanner;
public class Number {
private int numberEntered;
private int firstDigit;
private int secondDigit;
private int thirdDigit;
private int fourthDigit;
private int...
How do you loop this code so that if they entered the wrong digits the second time it will go back to "enter number again and start the "if" and "else" statement again"
public class Assign1 {
...
(blue indicate user entered information, red indicates
display from program)
Enter a five digit number: 12345
The number is
1
2
3
4
5
Your class should be called Number. It should contain 6 fields of type int
named correspondingly for numberEntered, firstDigit, secondDigit, thirdDigit,
fourthDigit and fifthDigit. You should...
import java.lang.*; //all import statements must be first
import java.util.Scanner; //program uses class Scanner
/** prompts user to enter 10 numbers, then displays largest and
* average of...