Windows Builder(图形化界面的利器)For Eclipse 3.7

工欲善其事,必先利其器——孔子(春秋)《论语·卫灵公》

今天闲逛论坛的时候,发现了Eclipse 的很好的插件,是关于做图形界面的,如果想做桌面应用软件,交互界面有点复杂的时候,自己手动敲代码就有点说不过去了,应该更专注在功能的实现上面嘛,

好了,废话就不说了,自己装了试了试,感觉不错!

1.下载还是去官网吧里面有各个Eclipse版本对应的的下载链接,(发现我3.7版本的Eclipse取名叫 Indigo,没记错的话是德国产的滑雪产品,和LV包包一样,香港空间,是奢侈品);

2.开始安装了,Help—–>Install New Software—–>可以本地离线安装或者在线安装;

3.Name 随便了,服务器空间,选择你下载的插件,一路 Next 下去,最后 Finish 重启 Eclipse;

4.激动人心的时刻马上就要到了,File—–>new—–>others—->就可以看到刚装的插件了;

里面有可视化的组件,直接点,然后在 JPanel 或者 JFrame 中添加就可以,很方便,参数都可以很直观的看到:

左边是参数,组件库一些东西,右边是要设计的界面,迫不及待就做了一个学校连网的客户端的界面,没有添加事件注册,大概花了15分钟左右的时间,绝对提高效率的好东西,不用编写一大堆的代码。

而且生成的代码也很简洁:

View Code

1 import java.awt.EventQueue; SwingDrag { JFrame frame; 7private JTextField textField; 8private JTextField textField_1;* Launch the application. main(String[] args) { 14EventQueue.invokeLater(new Runnable() { run() { 16try { 17SwingDrag window = new SwingDrag(); 18window.frame.setVisible(true); 19} catch (Exception e) { 20 e.printStackTrace(); 21 } 22 } 23 }); 24 }* Create the application. SwingDrag() { 30 initialize(); 31 }* Initialize the contents of the frame. initialize() { 37frame = new JFrame(); 38 frame.getContentPane().setBackground(Color.WHITE); 39frame.setTitle(“\u9510\u6377\u8BA4\u8BC1\u5BA2\u6237\u7AEF”); 40frame.setBackground(new Color(204, 255, 204)); 41frame.setBounds(100, 100, 452, 418); 42 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 43frame.getContentPane().setLayout(null); 44 45JPanel panel = new JPanel(); 46panel.setBounds(0, 0, 0, 0); 47panel.setBackground(new Color(255, 255, 204)); 48 frame.getContentPane().add(panel); 49panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); 50 51Panel panel_1 = new Panel(); 52 panel_1.setBackground(Color.GREEN); 53panel_1.setBounds(0, 0, 436, 59); 54 frame.getContentPane().add(panel_1); 55 56JLabel lblNewLabel = new JLabel(“Supplicant 4.44-1220”); 57lblNewLabel.setBounds(10, 71, 145, 15); 58 frame.getContentPane().add(lblNewLabel); 59 60JLabel lblNewLabel_1 = new JLabel(“\u8BA4\u8BC1\u65B9\u5F0F\uFF1A”); 61lblNewLabel_1.setBounds(53, 104, 69, 15); 62 frame.getContentPane().add(lblNewLabel_1); 63 64JLabel lblNewLabel_2 = new JLabel(“\u7528 \u6237 \u540D\uFF1A”); 65lblNewLabel_2.setBounds(53, 140, 69, 15); 66 frame.getContentPane().add(lblNewLabel_2); 67 68JLabel lblNewLabel_3 = new JLabel(“\u5BC6 \u7801\uFF1A”); 69lblNewLabel_3.setBounds(53, 177, 69, 15); 70 frame.getContentPane().add(lblNewLabel_3); 71 72JLabel lblNewLabel_4 = new JLabel(“\u670D \u52A1\uFF1A”); 73lblNewLabel_4.setBounds(53, 216, 69, 15); 74 frame.getContentPane().add(lblNewLabel_4); 75 76JLabel lblNewLabel_5 = new JLabel(“\u8BED \u8A00\uFF1A”); 77lblNewLabel_5.setBounds(53, 257, 69, 15); 78 frame.getContentPane().add(lblNewLabel_5); 79 80JLabel lblNewLabel_6 = new JLabel(“\u7F51 \u5361\uFF1A”); 81lblNewLabel_6.setBounds(53, 296, 69, 15); 82 frame.getContentPane().add(lblNewLabel_6); 83 84JComboBox comboBox = new JComboBox(); 85comboBox.setModel(new DefaultComboBoxModel(new String[] {“\u7528\u6237\u540D\u5BC6\u7801\u8BA4\u8BC1\uFF08\u6709\u7EBF\uFF09”, “\u65E0\u7EBF\u8BA4\u8BC1”})); 86comboBox.setToolTipText(“”); 87comboBox.setBounds(132, 101, 239, 21); 88 frame.getContentPane().add(comboBox); 89 90textField = new JTextField(); 91textField.setBounds(132, 137, 239, 21); 92 frame.getContentPane().add(textField); 93textField.setColumns(10); 94 95textField_1 = new JTextField(); 96textField_1.setBounds(132, 174, 239, 21); 97 frame.getContentPane().add(textField_1); 98textField_1.setColumns(10); 99100JComboBox comboBox_1 = new JComboBox();101comboBox_1.setModel(new DefaultComboBoxModel(new String[] {“internet1”, “internet2”, “internet3”, “internet4”}));102comboBox_1.setBounds(132, 213, 239, 21);103 frame.getContentPane().add(comboBox_1);104105JComboBox comboBox_2 = new JComboBox();106comboBox_2.setModel(new DefaultComboBoxModel(new String[] {“\u4E2D\u6587”, “English”}));107comboBox_2.setBounds(132, 254, 239, 21);108 frame.getContentPane().add(comboBox_2);109110JComboBox comboBox_3 = new JComboBox();111comboBox_3.setModel(new DefaultComboBoxModel(new String[] {“Brodcam 4313GN 802.11”, “Realtek RTL8102E/RTL8103E \u7CFB\u5217 PCI-E”}));112comboBox_3.setBounds(132, 293, 239, 21);113 frame.getContentPane().add(comboBox_3);114115JRadioButton rdbtnNewRadioButton = new JRadioButton(“\u8BB0\u4F4F\u5BC6\u7801”);116 rdbtnNewRadioButton.setBackground(Color.WHITE);117rdbtnNewRadioButton.setBounds(278, 320, 91, 23);118 frame.getContentPane().add(rdbtnNewRadioButton);119120JButton button = new JButton(“\u8FDE\u63A5”);121button.setBounds(35, 347, 83, 23);122 frame.getContentPane().add(button);123124JButton button_1 = new JButton(“\u9000\u51FA”);125button_1.addActionListener(new ActionListener() { actionPerformed(ActionEvent e) {127 }128 });129button_1.setBounds(135, 347, 83, 23);130 frame.getContentPane().add(button_1);131132JButton button_2 = new JButton(“\u8BBE\u7F6E”);133button_2.setBounds(343, 347, 83, 23);134 frame.getContentPane().add(button_2);135136JButton btnNewButton = new JButton(“\u6D88\u606F\u7BA1\u7406”);137btnNewButton.addActionListener(new ActionListener() { actionPerformed(ActionEvent arg0) {139 }140 });141btnNewButton.setBounds(234, 347, 91, 23);142 frame.getContentPane().add(btnNewButton);143 }144 },香港服务器勇于接受自己的不完美,认清自己不足的地方,

Windows Builder(图形化界面的利器)For Eclipse 3.7

相关文章:

你感兴趣的文章:

标签云: