JInternalFrame 内组件显示不出来
import java.awt.*;import javax.swing.*;
import java.awt.event.*;
public class ShowOut extends JFrame {
public ShowOut(String title){
super(title);
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent w){
System.exit(0);
}
});
setSize(820,820);
setVisible(true);
Container c=getContentPane();
c.setLayout(new BorderLayout());
final JDesktopPane desktoppane=new JDesktopPane();
c.add(desktoppane,BorderLayout.CENTER);
desktoppane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
final JInternalFrame internalframe=new JInternalFrame("游戏",true,true,true,true);
internalframe.show();
internalframe.setBounds(20,20, 770,770 );
desktoppane.add(internalframe);
final JButton login=new JButton("登陆");
JButton fenpai=new JButton("分牌");
JButton start=new JButton("开始运行");
JButton save=new JButton("保存");
final JToolBar 易做图=new JToolBar();
易做图.setBounds(10, 10, 50, 20);
易做图.setLayout(new GridLayout(10,1,0,1));
易做图.setOrientation(JToolBar.VERTICAL);
易做图.add(login);
易做图.add(fenpai);
易做图.add(start);
易做图.add(save);
final JTextArea textarea=new JTextArea();
textarea.setLineWrap(true);
textarea.setVisible(true);
textarea.setColumns(100);
JLabel label=new JLabel();
JPanel showpanel=new JPanel();
JPanel textpanel=new JPanel();
JPanel toolpanel=new JPanel();
textpanel.add(textarea);
showpanel.setBackground(new Color(200,200,200));
showpanel.add(label);
toolpanel.add(易做图);
showpanel.setVisible(true);
internalframe.getContentPane().setLayout(new BorderLayout());
internalframe.add(toolpanel,BorderLayout.WEST);
internalframe.add(showpanel,BorderLayout.CENTER);
internalframe.add(textpanel,BorderLayout.EAST);
}
} --------------------编程问答-------------------- 帮帮忙
补充:Java , Eclipse