📄 simage.java~29~
字号:
package com.aptech.cdjj.sex.gui;
/**
* 测试调用JPanel
*/
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Rectangle;
public class SImage extends JPanel{
SImage(){
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
this.setSize(700,600);
this.setVisible(true);
}
public static void main(String[] args) {
SImage si = new SImage();
}
private void jbInit() throws Exception {
jPanel1.setLayout(borderLayout1);
jPanel2.setLayout(null);
jLabel1.setText("jLabel1");
jLabel1.setBounds(new Rectangle( -398, 0, 797, 548));
this.add(jPanel1);
jPanel1.add(jPanel2, java.awt.BorderLayout.SOUTH);
jPanel2.add(jLabel1);
ImageIcon image=new ImageIcon("F:/Jewelry/desktop/20050118xy001_(3).jpg");
jLabel1.setBounds(0,0,image.getIconWidth(),image.getIconHeight());
jLabel1.setIcon(image);
}
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
BorderLayout borderLayout1 = new BorderLayout();
JLabel jLabel1 = new JLabel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -