分类：电脑/网络-程序设计-JAVA相关
问题：求高手编写一道java题题目：编写一道随机数的题。要求：题中要包 
题目：编写一道随机数的题。要求：题中要包括标签、文本框、按钮。最好要有布局，的不需要体现出来。高手们如果有不明白的可提出，我也是受人之托。 
回答：package iA;import  t.BorderLayout;import  t.Rectangle;import java.util.Random;import javax.swing.JButton;import javax.swing.JDesktopPane;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JPanel;import javax.swing.JTextField;import javax.swing.SwingConstants;public class Test extends JFrame {  private static final long serialVersionUID = 1L;  private JPanel jContentPane = null;  private JDesktopPane jDesktopPane = null;  private JLabel jLabel = null;  private JTextField jTextField = null;  private JButton jButton = null;  public Test() {    super();    initialize();  }  private void initialize() {     tSize(300, 200);     tContentPane(getJContentPane());     tTitle("Random Number");  }  private JPanel getJContentPane() {    if (jContentPane == null) {      jContentPane = new JPanel();       tLayout(new BorderLayout());       d(getJDesktopPane(), BorderLayout.CENTER);    }    return jContentPane;  }  private JDesktopPane getJDesktopPane() {    if (jDesktopPane == null) {      jLabel = new JLabel();       tBounds(new Rectangle(13, 27, 268, 61));       tHorizontalAlignment(SwingConstants.CENTER);       tHorizontalTextPosition(SwingConstants.CENTER);       tText("Please input a number then clink the button!");      jDesktopPane = new JDesktopPane();       d(jLabel, null);       d(getJTextField(), null);       d(getJButton(), null);    }    return jDesktopPane;  }  private JTextField getJTextField() {    if (jTextField == null) {      jTextField = new JTextField();       tBounds(new Rectangle(93, 98, 106, 22));    }    return jTextField;  }  private JButton getJButton() {    if (jButton == null) {      jButton = new JButton();       tBounds(new Rectangle(99, 129, 93, 18));       tText("OK");       dActionListener(new  t.event.ActionListener() {        public void actionPerformed( t.event.ActionEvent e) {          Random rand = new Random();          try{             tText("Random number: " +  xtInt( rseInt( tText())));          } catch (Exception ee) {             tText("Please input a number then clink the button!");          }        }      });    }    return jButton;  }    public static void main(String[] args){    (new Test()).setVisible(true);  }}