收藏 (0) +1 (0) +1 (0) +1
收藏成功查看收藏>>

正在阅读:实战Java用户界面本地化实战Java用户界面本地化

2004-02-14 09:34 出处:PConline 作者:sxhv998/CSDN 责任编辑:linjixiong

         private MyNativePanel panel;

         private static final int WIDTH=400;

         private static final int HEIGHT=100;

  }

  class MyNativePanel extends JPanel{

         public MyNativePanel(){

                   layout=new BorderLayout();

                   setLayout(layout);

                   txt=new JTextField(50);

                   add(txt,layout.CENTER);

                   cmdRed=new JButton();

                   cmdBlue=new JButton();

                   cmdGreen=new JButton();

                   panel.add(cmdRed);

                   panel.add(cmdBlue);

                   panel.add(cmdGreen);

                   add(panel,layout.SOUTH);

                   cmdRed.addActionListener(new ActionListener(){

                            public void actionPerformed(ActionEvent e){

                                     String s = e.getActionCommand();

                                     txt.setBackground(Color.red);

                                     txt.setText(s);

                            }

                   });

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
手机访问回到顶部