📄 graph.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.*;
public class graph extends JFrame implements ActionListener
{
private Container cp;
public JButton but;
private test t;
public graph()
{
super("Draw graph");
cp=getContentPane();cp.setBackground(Color.darkGray);
cp.setLayout(null);
t=new test();
t.setText("thuan");
t.setBounds(10,10,400,400);
cp.add(t);
but=new JButton("Click here");
but.setBounds(410,10,200,20);
but.addActionListener(this);
cp.add(but);
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==but)
{
t.setText("gfgf<sqrt>Thuannd</sqrt>");
}
}
public static void main(String arg[])
{
graph t=new graph();
t.setSize(800,500);
t.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -