• 大小: 7KB
    文件类型: .zip
    金币: 2
    下载: 0 次
    发布日期: 2024-02-05
  • 语言: Java
  • 标签: Java  Opencv  

资源简介

Java Opencv系列:(配套代码下载)1.2WindowBuilder使用

资源截图

代码片段和文件信息

package test;

import java.awt.EventQueue;

import javax.swing.Jframe;
import javax.swing.JLabel;
import java.awt.BorderLayout;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class testWindowBuilderButton {

private Jframe frame;

/**
 * Launch the application.
 */
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
testWindowBuilderButton window = new testWindowBuilderButton();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
 * Create the application.
 */
public testWindowBuilderButton() {
initialize();
}

/**
 * Initialize the contents of the frame.
 */
private void initialize() {
frame = new Jframe();
frame.setBounds(100 100 450 300);
frame.setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

JLabel lblNewLabel = new JLabel(“New label“);
lblNewLabel.setBounds(14 80 80 18);
frame.getContentPane().add(lblNewLabel);

JButton btnNewButton = new JButton(“New button“);
btnNewButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
//添加点击按钮之后的操作
frame.setBounds(001000800);//设置窗体位置和大小
lblNewLabel.setIcon(new ImageIcon(“F://lena.jpg“));//加载图像
lblNewLabel.setBounds(100100800600);//设置label位置和大小
}
});
btnNewButton.setBounds(122 30 113 27);
frame.getContentPane().add(btnNewButton);
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-03-27 15:13  1.2WindowBuilder使用(代码下载)\
     目录           0  2017-03-27 15:13  1.2WindowBuilder使用(代码下载)\testWindowBuilder\
     文件         301  2017-03-24 10:17  1.2WindowBuilder使用(代码下载)\testWindowBuilder\.classpath
     文件         393  2017-03-24 10:17  1.2WindowBuilder使用(代码下载)\testWindowBuilder\.project
     目录           0  2017-03-27 15:13  1.2WindowBuilder使用(代码下载)\testWindowBuilder\.settings\
     文件         598  2017-03-24 10:17  1.2WindowBuilder使用(代码下载)\testWindowBuilder\.settings\org.eclipse.jdt.core.prefs
     目录           0  2017-03-27 15:13  1.2WindowBuilder使用(代码下载)\testWindowBuilder\bin\
     目录           0  2017-03-27 15:13  1.2WindowBuilder使用(代码下载)\testWindowBuilder\bin\test\
     文件         886  2017-03-24 10:56  1.2WindowBuilder使用(代码下载)\testWindowBuilder\bin\test\testWindowBuilderButton$1.class
     文件        1118  2017-03-24 10:56  1.2WindowBuilder使用(代码下载)\testWindowBuilder\bin\test\testWindowBuilderButton$2.class
     文件        1707  2017-03-24 10:56  1.2WindowBuilder使用(代码下载)\testWindowBuilder\bin\test\testWindowBuilderButton.class
     目录           0  2017-03-27 15:13  1.2WindowBuilder使用(代码下载)\testWindowBuilder\src\
     目录           0  2017-03-27 15:13  1.2WindowBuilder使用(代码下载)\testWindowBuilder\src\test\
     文件        1682  2017-03-24 10:56  1.2WindowBuilder使用(代码下载)\testWindowBuilder\src\test\testWindowBuilderButton.java

评论

共有 条评论