java swing jInternalFrame组件例子

 
package InterFrameee;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import org.dyno.visual.swing.layouts.Constraints;
import org.dyno.visual.swing.layouts.GroupLayout;
import org.dyno.visual.swing.layouts.Leading;
//VS4E -- DO NOT REMOVE THIS LINE!
public class InteFrameee extends JFrame {
 private static final long serialVersionUID = 1L;
 private JInternalFrame jInternalFrame0;
 private JButton jButton0;
 private JTextField jTextField0;
 private static final String PREFERRED_LOOK_AND_FEEL = "javax.swing.plaf.metal.MetalLookAndFeel";
 public InteFrameee() {
  initComponents();
 }
 private void initComponents() {
  setLayout(new GroupLayout());
  add(getJInternalFrame0(), new Constraints(new Leading(24, 234, 10, 10), new Leading(12, 133, 10, 10)));
  setSize(320, 240);
 }
 private JTextField getJTextField0() {
  if (jTextField0 == null) {
   jTextField0 = new JTextField();
   jTextField0.setText("jTextField0");
  }
  return jTextField0;
 }
 private JButton getJButton0() {
  if (jButton0 == null) {
   jButton0 = new JButton();
   jButton0.setText("jButton0");
  }
  return jButton0;
 }
 private JInternalFrame getJInternalFrame0() {
  if (jInternalFrame0 == null) {
   jInternalFrame0 = new JInternalFrame();
   jInternalFrame0.setTitle("hello");
   jInternalFrame0.setVisible(true);
   jInternalFrame0.setLayout(new GroupLayout());
   jInternalFrame0.add(getJButton0(), new Constraints(new Leading(129, 10, 10), new Leading(30, 10, 10)));
   jInternalFrame0.add(getJTextField0(), new Constraints(new Leading(22, 10, 10), new Leading(38, 10, 10)));
  }
  return jInternalFrame0;
 }
 private static void installLnF() {
  try {
   String lnfClassname = PREFERRED_LOOK_AND_FEEL;
   if (lnfClassname == null)
    lnfClassname = UIManager.getCrossPlatformLookAndFeelClassName();
   UIManager.setLookAndFeel(lnfClassname);
  } catch (Exception e) {
   System.err.println("Cannot install " + PREFERRED_LOOK_AND_FEEL
     + " on this platform:" + e.getMessage());
  }
 }
 /**
  * Main entry of the class.
  * Note: This class is only created so that you can easily preview the result at runtime.
  * It is not expected to be managed by the designer.
  * You can modify it as you like.
  */
 public static void main(String[] args) {
  installLnF();
  SwingUtilities.invokeLater(new Runnable() {
   @Override
   public void run() {
    InteFrameee frame = new InteFrameee();
    frame.setDefaultCloseOperation(InteFrameee.EXIT_ON_CLOSE);
    frame.setTitle("InteFrameee");
    frame.getContentPane().setPreferredSize(frame.getSize());
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
   }
  });
 }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值