unl*_*hed 7 java size swing jtextfield
JTextField当Frame最大化时,如何获得固定高度?我希望它看起来与Ubuntu上的Skype应用程序类似.
private JTextField username;
private JPasswordField password;
private JLabel usernamelabel;
private JLabel passwordlabel;
public LoginPanel(){
setSize(200,200);
setLayout(new GridLayout(4,4));
setBackground(new Color(85,153,187));
setBorder(BorderFactory.createEmptyBorder(70, 70, 70, 70));
username = new JTextField();
password = new JPasswordField();
usernamelabel= new JLabel("Username");
passwordlabel= new JLabel("Password");
username.setBounds(5, 5, 100, 100);
username.setPreferredSize(new Dimension(80,20));
password.setPreferredSize(new Dimension(80,20));
add(usernamelabel);
add(username);
add(passwordlabel);
add(password);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
59724 次 |
| 最近记录: |