📄 simage.java~34~
字号:
package com.aptech.cdjj.sex.gui;
/**
* 测试调用JPanel
*/
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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 {
jButton1.setText("jButton1");
jButton1.addActionListener(new SImage_jButton1_actionAdapter(this));
this.add(jPanel1);
this.add(jButton1);
jPanel2.add(jLabel1);
jLabel1.setIcon(new ImageIcon("F:/Jewelry/desktop/20050118xy001_(3).jpg"));
jPanel1.setLayout(borderLayout1);
jPanel1.add(jPanel2, java.awt.BorderLayout.SOUTH);
jPanel2.setLayout(null);
}
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
BorderLayout borderLayout1 = new BorderLayout();
JLabel jLabel1 = new JLabel();
JButton jButton1 = new JButton();
public void jButton1_actionPerformed(ActionEvent e) {
SMainMenu smm = new SMainMenu();
}
}
class SImage_jButton1_actionAdapter implements ActionListener {
private SImage adaptee;
SImage_jButton1_actionAdapter(SImage adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -