已解决问题
谷歌comer88用户在2013.09.03提交了关于“捡个校花做老婆j**a窗体居中显示”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2024-07-30T09:06:16。packagedemo;importj**a.awt.BorderLayout;
importj**a.awt.Container;
importj**a.io.File;
importj**ax.swing.Icon;
importj**ax.swing.ImageIcon;
importj**ax.swing.JDesktopPane;
importj**ax.swing.JFrame;
importj**ax.swing.JInternalFrame;
importj**ax.swing.JLabel;
importj**ax.swing.JPanel;
importj**ax.swing.JScrollPane;
publicclassDemo3{
publicstaticvoidmain(Stringargs[]){
JFramef=newJFrame("美女");
Containercont=f.getContentPane();
JDesktopPanedesk=newJDesktopPane();
cont.add(desk,***.CENTER);
cont.add(newJLabel("**窗体"),BorderLayout.SOUTh**);
Stringpicpath="g:"+File.separator+"2.jpg";
Iconicon=newImageIcon(picpath);
JInternalFrameter=newJInternalFrame("美女",false,false,false,true);
JPanelpan2=newJPanel();
JLabellab=newJLabel(icon);
pan2.add(lab);
JScrollPanescr=**ll;
scr=newJScrollPane(pan2,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.h**ORIZONTAL_SCROLLBAR_ALWAYS);
ter.add(scr);
ter.setSize(480,500);
ter.setVisible(true);
desk.add(ter);
f.setSize(500,600);
f.setVisible(true);
}
}
帮忙修改一下代码,让窗体居中显示!希望大家能够帮助她。
详细问题描述及疑问:packagedemo;
importj**a.awt.BorderLayout;
importj**a.awt.Container;
importj**a.io.File;
importj**ax.swing.Icon;
importj**ax.swing.ImageIcon;
importj**ax.swing.JDesktopPane;
importj**ax.swing.JFrame;
importj**ax.swing.JInternalFrame;
importj**ax.swing.JLabel;
importj**ax.swing.JPanel;
importj**ax.swing.JScrollPane;
publicclassDemo3{
publicstaticvoidmain(Stringargs[]){
JFramef=newJFrame("美女");
Containercont=f.getContentPane();
JDesktopPanedesk=newJDesktopPane();
cont.add(desk,***.CENTER);
cont.add(newJLabel("**窗体"),BorderLayout.SOUTh**);
Stringpicpath="g:"+File.separator+"2.jpg";
Iconicon=newImageIcon(picpath);
JInternalFrameter=newJInternalFrame("美女",false,false,false,true);
JPanelpan2=newJPanel();
JLabellab=newJLabel(icon);
pan2.add(lab);
JScrollPanescr=**ll;
scr=newJScrollPane(pan2,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.h**ORIZONTAL_SCROLLBAR_ALWAYS);
ter.add(scr);
ter.setSize(480,500);
ter.setVisible(true);
desk.add(ter);
f.setSize(500,600);
f.setVisible(true);
}
}
帮忙修改一下代码,让窗体居中显示!期待您的答案,当代劳模,所有人都应该向你学习
!