网站结构如何优化,wordpress4.7.10漏洞,大连网站制作培训,wordpress 上传图片缩小我的程序代码如下#xff0c;试了加背景的方法虽然程序没有错误#xff0c;但是背景还是显示不出来#xff0c;按钮的setsize好像也不起作用#xff0c;希望高人能助一臂之力#xff0c;小女子先写过各位了#xff1a;、、、、importjava.awt....我的程序代码如下#x…我的程序代码如下试了加背景的方法虽然程序没有错误但是背景还是显示不出来按钮的setsize好像也不起作用希望高人能助一臂之力小女子先写过各位了、、、、importjava.awt....我的程序代码如下试了加背景的方法虽然程序没有错误但是背景还是显示不出来按钮的setsize好像也不起作用希望高人能助一臂之力小女子先写过各位了、、、、 import java.awt.*; import javax.swing.*; public class MainFrame extends JFrame { public static void main(String[] args) { JFrame framenew JFrame(补考管理系统); frame.setSize(300,200); frame.setBackground(Color.gray); /*((JPanel) frame.getContentPane()).setOpaque(false); // Winter.jpg这个图片的位置要跟当前这个类是同一个包下 ImageIcon img new ImageIcon(c://aaa.jpeg); JLabel background new JLabel(img); frame.getLayeredPane().add(background, new Integer(Integer.MIN_VALUE)); background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight()); */ ImageIcon img new ImageIcon(//practice//src//img//login_mainbg.jpg);//这是背景图片 JLabel imgLabel new JLabel(img);//将背景图放在标签里。 frame.getLayeredPane().add(imgLabel, new Integer(Integer.MIN_VALUE));//注意这里是关键将背景标签添加到jfram的LayeredPane面板里。 imgLabel.setBounds(0,0,img.getIconWidth(), img.getIconHeight());//设置背景标签的位置 //JFrame framenew JFrame(补考管理系统); // frame.addComponent(new FrameListener());//添加监听器 //设置用户关闭框架时的响应动作 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel titlenew JLabel(欢迎进入补考管理系统); Font fntnew Font(Serief,Font.BOLDFont.ITALIC,40); title.setFont(fnt); Panel userpannew Panel();//用户信息面板 JLabel userlabnew JLabel(用户名:); JLabel mmlabnew JLabel(密码:); JTextField usernamenew JTextField(); TextField passwordnew TextField(6); JButton loginnew JButton(登录); JButton Resetnew JButton(重置); password.setEchoChar(*); //login.resize(5,5); // Reset.resize(5,5); userpan.setSize(100,100); userpan.setLocation(300,300); userpan.setLayout(new GridLayout(3,2,0,5)); //3行2列的网格布局管理器 userpan.add(userlab); userpan.add(username); userpan.add(mmlab); userpan.add(password); userpan.add(login); userpan.add(Reset); frame.add(title,BorderLayout.NORTH); frame.add(userpan,BorderLayout.CENTER); frame.setResizable(false); frame.setVisible(true); } }展开