import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
@SuppressWarnings("serial")
public class bank extends JFrame {
public static final String butt>
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
bank frame = new bank();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
//손님좌표 (접수대1 좌표 135,170/접수대2 좌표 365,170)
int x1=100;
int y1=240;
int x2=200;
int y2=240;
int x3=300;
int y3=240;
int x4=400;
int y4=240;
public void actionPerformed(ActionEvent event)
{
if (event.getSource()==button1);// 단추처리
System.out.println("출력");
x1=135;
y1=170;
}
Panel pers Panel );
person1.setBackground(Color.red);
person1.setBounds(x1, y1, 45, 45);
getContentPane().add(person1);
Panel pers Panel );
person2.setBackground(Color.red);
person2.setBounds(x2, y2, 45, 45);
getContentPane().add(person2);
Panel pers Panel );
person3.setBackground(Color.red);
person3.setBounds(x3, y3, 45, 45);
getContentPane().add(person3);
Panel pers Panel );
person4.setBackground(Color.red);
person4.setBounds(x4, y4, 45, 45);
getContentPane().add(person4);
JButton butt JButton("시작");
button1.setBounds(12, 10, 100, 30);
getContentPane().add(button1);
쌩판 첨으로 자바 손대는데요
이런식으로해서 버튼누르면 판넬 좌표 바뀌게해서판넬움직이게 하고싶은데 뭐때매안돼는거죠 고쳐지게 도와주세요
댓글 0