⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 complete14_3.java

📁 北京大学出版社的
💻 JAVA
字号:
package questions.c14;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Complete14_3 extends JApplet {
   public void init() {
      // arrange the components in a single column
      Container cp = getContentPane();
      cp.setLayout( new GridLayout( 0, 1 ) );
      cp.add( new JLabel(
              "Please enter a measurement:" ) );
      final JTextField value = new JTextField( "0.0" );
      cp.add( value );
      JPanel lowerPanel = new JPanel();
      JButton f2m = new JButton( "Feet to Meters" );
      JButton m2f = new JButton( "Meters to Feet" );

      // create your button event handlers here and
      // attach them to the buttons f2m and m2f

      lowerPanel.add( f2m );
      lowerPanel.add( m2f );
      cp.add( lowerPanel, BorderLayout.SOUTH );
      setSize( 200, 100 );
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -