我必须Login Form
在Swing
. JButton
ActionListner
所以我写了以下代码:
private void Balance() throws IOException {
getContentPane().removeAll();
JPanel test = new JPanel();
JLabel singin = new JLabel();
javax.swing.ImageIcon icon = createImageIcon(
"https://dl.dropboxusercontent.com/u/20476478/Capture.PNG",
"a pretty but meaningless splat");
singin.setIcon(icon);
test.add(singin);
getContentPane().add(test);
repaint();
printAll(getGraphics());
}
它创建如下 UI:
But i am looking for this:
我尝试了很多,但无法适应上述尺寸。我刚开始学习Swing