📄 testnewtimer.java
字号:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TestNewTimer extends JFrame
{
public static void main(String[] args)
{
// TestNewTimer t = new TestNewTimer();
// t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// t.setVisible(true);
System.out.println("20/10"+20/10);
System.out.println("21/10"+21/10);
System.out.println("22/10"+22/10);
System.out.println("23/10"+23/10);
System.out.println("24/10"+24/10);
System.out.println("25/10"+25/10);
System.out.println("26/10"+26/10);
System.out.println("27/10"+27/10);
System.out.println("28/10"+28/10);
System.out.println("29/10"+29/10);
System.out.println("30/10"+30/10);
}
private JPanel p1 = null;
private JPanel p2 = null;
public TestNewTimer()
{
this.setBounds(100, 10, 300, 200);
this.setLayout(null);
p1 = new JPanel();
p2 = new JPanel();
JButton b1 = new JButton();
p1.setBounds(0, 10, 50, 50);
p2.setBounds(0, 70, 50, 50);
b1.setBounds(0, 150, 50, 50);
p1.setBackground(Color.RED);
p2.setBackground(Color.BLUE);
Container con = this.getContentPane();
con.add(p1);
con.add(p2);
con.add(b1);
b1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event)
{
//p1.setVisible(false);
TestNewTimer.this.getContentPane().remove(p1);
}
} );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -