📄 applet1.java~1~
字号:
package 螺旋传动;import java.awt.*;import java.awt.event.*;import java.applet.*;public class Applet1 extends Applet { private boolean isStandalone = false; private Panel panel1 = new Panel(); private Label label1 = new Label(); private Button button1 = new Button(); private Button button2 = new Button(); private Label label2 = new Label(); //Get a parameter value public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } //Construct the applet public Applet1() { } //Initialize the applet public void init() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { this.setLayout(null); panel1.setBounds(new Rectangle(-1, 1, 401, 301)); panel1.setLayout(null); label1.setFont(new java.awt.Font("Dialog", 1, 20)); label1.setText("螺旋传动设计"); label1.setBounds(new Rectangle(136, 40, 126, 41)); button1.setLabel("进行设计"); button1.setBounds(new Rectangle(49, 216, 99, 36)); button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { button1_actionPerformed(e); } }); button2.setLabel("退出"); button2.setBounds(new Rectangle(211, 217, 109, 36)); button2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { button2_actionPerformed(e); } }); label2.setText("螺旋传动是将旋转运动转化为直线运动的传动机构"); label2.setBounds(new Rectangle(57, 114, 276, 38)); this.add(panel1, null); panel1.add(label1, null); panel1.add(button2, null); panel1.add(button1, null); panel1.add(label2, null); } //Get Applet information public String getAppletInfo() { return "Applet Information"; } //Get parameter info public String[][] getParameterInfo() { return null; } void button2_actionPerformed(ActionEvent e) {System.exit(0); } void button1_actionPerformed(ActionEvent e) {Frame1 frame1=new Frame1();frame1.setSize(400,500);frame1.show(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -