Java-幻灯片形式的图片浏览器

直接上图
Java幻灯片形式的图片浏览器

Java幻灯片形式的图片浏览器

Java幻灯片形式的图片浏览器

Java幻灯片形式的图片浏览器

Java幻灯片形式的图片浏览器

代码实现如下

package photo;

import javax.swing.*;
import javax.swing.Timer;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import java.awt.event.*;
import java.awt.*;
import java.io.*;
import java.net.URI;
import java.util.*;
import java.util.zip.*;
@SuppressWarnings("unused")
public class pictureWatcher extends JFrame {
	private static final long serialVersionUID = 1L;
	//实现序列化,serialVersionUID 用来表明实现序列化类的不同版本间的兼容性

int t=5;
String pt;
File[] files2;
JLabel[] imageLabel;
JLabel jlabel, jimageLabel;
JPanel jp1, jp2, jp3;
JMenuItem b1 = new JMenuItem("分类一");
JMenuItem b2 = new JMenuItem("分类二");
JMenuItem b3 = new JMenuItem("分类三");
JMenuItem b4 = new JMenuItem("分类四");
private JTree tree;
private JScrollPane jsp1, jsp2, jsp3;
Timer timer,timer1,timer2,timer3;
public pictureWatcher() {
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu open = new JMenu("按类打开");
JMenu menu = new JMenu("文件"); // 文件menu
menuBar.add(menu);
menu.add(open);
open.add(b1);
b1.addActionListener(new JCAction());
open.add(b2);
b2.addActionListener(new JCAction());
open.add(b3);
b3.addActionListener(new JCAction());
open.add(b4);
b4.addActionListener(new JCAction());
JMenu menu1 = new JMenu("分类"); // 分类menu
menuBar.add(menu1);
JMenuItem c1 = new JMenuItem("分类一"); // 函数 4.分类实现
menu1.add(c1);
c1.addActionListener(new FileDidianListener());
JMenuItem c2 = new JMenuItem("分类二");
menu1.add(c2);
c2.addActionListener(new FileRenwuListener());
JMenuItem c3 = new JMenuItem("分类三");
menu1.add(c3);
c3.addActionListener(new FileXiangceListener());
JMenuItem c4 = new JMenuItem("分类四");
menu1.add(c4);
c4.addActionListener(new FileQitaListener());
JMenu menu2 = new JMenu("数据库");// 数据库按钮 //数据库menu
menuBar.add(menu2);
JMenuItem s1 = new JMenuItem("备份");
menu2.add(s1);
s1.addActionListener(new FileZipListener());
JMenu menu3 = new JMenu("幻灯片播放");// 播放按钮 //幻灯片menu
menuBar.add(menu3);
JMenuItem h1 = new JMenuItem("自动播放");
menu3.add(h1);
h1.addActionListener(new FileStartListener());
JMenuItem h2 = new JMenuItem("手动播放");
menu3.add(h2);
h2.addActionListener(new StartListener());

JMenuItem colourOpen = new JMenuItem("复制");
menu2.add(colourOpen);
colourOpen.addActionListener(new ColourListener());
jp1 = new JPanel();
jp2 = new JPanel();
jp3 = new JPanel();
imageLabel = new JLabel[50]; // 图片显示界面创建
for (int i = 0; i < imageLabel.length; i++) {
imageLabel[i] = new JLabel();
jp2.add(imageLabel[i]);
}
jimageLabel = new JLabel();
jimageLabel.setHorizontalAlignment(SwingConstants.CENTER);
tree = new JTree(); // 整体布局设置
jsp1 = new JScrollPane();
jsp2 = new JScrollPane();
jsp1.setViewportView(tree);
jsp2.getViewport().add(jp2);
add(jsp1, "West");
add(jsp2, "Center");
add(jp1, "North");
add(jp3, "East");
jp2.setLayout(new GridLayout(10, 5, 20, 20));
jp3.setLayout(new GridLayout(10, 1, 20, 20));
rootNode = new DefaultMutableTreeNode("我的电脑");    // 设置根节点
addWindowListener(new WindowAction());                 // 函数 1.
tree.addTreeSelectionListener(new TreeSelect());    // “我的电脑”路径检测、函数 2.
setTitle("图片浏览器"); // 基本属性设置
setSize(1210, 610);
setLocation(100, 50);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}

class WindowAction implements WindowListener { // 从根节点遍历路径
public void windowOpened(WindowEvent e) {
File[] disks = File.listRoots();
for (File file : disks) {
DefaultMutableTreeNode node = new DefaultMutableTreeNode(file);
rootNode.add(node);
}
tree.setModel(new DefaultTreeModel(rootNode));
tree.expandPath(new TreePath(rootNode));
}
public void windowActivated(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
public void windowClosing(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
}

class TreeSelect implements TreeSelectionListener { // 绝对路径方式打开文件
public void valueChanged(TreeSelectionEvent e) {
TreePath path = e.getPath();
DefaultMutableTreeNode node = (DefaultMutableTreeNode) path
.getLastPathComponent();
Object userObject = node.getUserObject();
if (!(userObject instanceof File)) {
return;
}
File folder = (File) userObject;
if (!folder.isDirectory())
return;
File[] files1 = initImageSets1(folder);
for (File file : files1) {
node.add(new DefaultMutableTreeNode(file));
}
files2 = initImageSets2(folder);
for (int i = 0; i < imageLabel.length; i++) {
imageLabel[i].setIcon(null);
imageLabel[i].setBorder(null);
}
for (int i = 0; i < files2.length; i++) {
imageLabel[i].setIcon(new ImageIcon(files2[i].toString()));
imageLabel[i].addMouseListener(new MouseAction());
imageLabel[i].setName(String.valueOf(i));
resizeIcon(new ImageIcon(files2[i].toString()), imageLabel[i]);
}
}
private File[] initImageSets1(File pictureDir) {
return pictureDir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
if (!new File(dir, name).isFile())
return true;
else
return false;
}
});
}
private File[] initImageSets2(File pictureDir) {
return pictureDir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
if (!new File(dir, name).isFile())
return false;
String lowserName = name.toLowerCase();
if (lowserName.endsWith("jpg")
|| lowserName.endsWith("jpeg")
|| lowserName.endsWith("gif")
|| lowserName.endsWith("png")
|| lowserName.endsWith("GIF")
|| lowserName.endsWith("TIFF")
|| lowserName.endsWith("ICO")
|| lowserName.endsWith("BMP")) {
return true;
}
return false;
}
});
}
}

class FileDidianListener implements ActionListener {            // 分类模块实现
public void actionPerformed(ActionEvent e) {
try {
save(pt, "分类一.txt");
JOptionPane.showMessageDialog(null, "分类为“分类一”完成!");
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
class FileRenwuListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
try {
save(pt, "分类二.txt");
JOptionPane.showMessageDialog(null, "分类为“分类二”完成!");
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
private DefaultMutableTreeNode rootNode;
class FileXiangceListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
try {
save(pt, "分类三.txt");
JOptionPane.showMessageDialog(null, "分类为“分类三”完成!");
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
class FileQitaListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
try {
save(pt, "分类四.txt");
JOptionPane.showMessageDialog(null, "分类为“分类四”完成!");
} catch (Exception e1) {
e1.printStackTrace();
}
}
}

class FileZipListener implements ActionListener {                 // 文件备份(转成压缩文件)
public void actionPerformed(ActionEvent e) {
try {
int a = 0;
File file1 = new File(pt);
File file2 = new File("备份信息.zip");
File f = new File("D:/1/3/5");
f.mkdirs();
if (!file2.exists()) {
file2.createNewFile();
a = 1;
} else
unzip("备份信息.zip", "D:/1/3/5");
FileOutputStream fos = new FileOutputStream(file2);
ZipOutputStream zos = new ZipOutputStream(fos);
byte[] buffer = new byte[1024];
if (a == 0) {
File[] files = f.listFiles();
File[] filess = new File[files.length + 1];
for (int i = 0; i < files.length; i++) {
filess[i] = files[i];
}
filess[filess.length - 1] = file1;
for (int i = 0; i < filess.length; i++) {
String[] st = filess[i].getName().split(".");
for (int j = 0; j < st.length; j++) {
JOptionPane
.showMessageDialog(null, j + "=" + st[j]);
}
ZipEntry entry = new ZipEntry(new Date().getTime()
+ filess[i].getName());
FileInputStream in = new FileInputStream(filess[i]);
zos.putNextEntry(entry);
int len;
while ((len = in.read(buffer)) > 0) {
zos.write(buffer, 0, len);
}
zos.closeEntry();
in.close();
}
}
if (a == 1) {
ZipEntry entry = new ZipEntry(new Date().getTime()
+ file1.getName());
FileInputStream fis = new FileInputStream(file1);
zos.putNextEntry(entry);
int read = 0;
while ((read = fis.read(buffer)) != -1) {
zos.write(buffer, 0, read);
}
zos.closeEntry();
fis.close();
}
zos.close();
fos.close();
JOptionPane.showMessageDialog(null, "备份完成!");
deleteFile(f);
} catch (Exception e1) {
e1.printStackTrace();
JOptionPane.showMessageDialog(null, "备份失败!");
File f = new File("F:\1/2/3");
deleteFile(f);
}
}
}

class MouseAction implements MouseListener {                 // 确定点击图片的绝对路径
public void mouseClicked(MouseEvent e) {
for (int i = 0; i < imageLabel.length; i++) {
imageLabel[i].setBorder(null);
}
JLabel jl = (JLabel) e.getSource();
jl.setBorder(new MatteBorder(5, 5, 5, 5, Color.GREEN));
for (int i = 0; i < 100; i++) {
if (i == Integer.parseInt(jl.getName())) {
pt = files2[i].toURI().toString().replace("file:/", "")
.replace("%20", " ");
break;
}
}
}
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
}

class FileStartListener implements ActionListener {      // 幻灯片自动播放模式实现
public void actionPerformed(ActionEvent e) {
JFrame f;
JPanel j;
JButton startBtn;
JButton stopBtn;
startBtn = new JButton("继续");
startBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ee) {
if (timer != null)
timer.start();
}
});
stopBtn = new JButton("暂停");
stopBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ee) {
if (timer != null)
timer.stop();
}
});
f = new JFrame("自动播放");
j = new JPanel();
JButton sure=new JButton("减速");
sure.addActionListener(new Listener());
JButton sure1=new JButton("加速");
sure1.addActionListener(new Listener1());
f.setSize(800, 600);
f.setLocation(300, 50);
f.setVisible(true);
Container c = f.getContentPane();
c.add(new JScrollPane(jimageLabel));
j.add(startBtn);
j.add(stopBtn);
j.add(sure);
j.add(sure1);
c.add(j, "South");
if (files2.length == 0)
return;
timer = null;
timer = new Timer(200, new ActionListener() {
int index = 0;
public void actionPerformed(ActionEvent el) {
jimageLabel.setIcon(new ImageIcon(new ImageIcon(
files2[index].toString()).getImage()
.getScaledInstance(750, 600, Image.SCALE_SMOOTH)));
index++;
index %= files2.length;
}
});
timer.setCoalesce(false);
timer.setDelay(t* 500);                        // 设置幻灯片播放时间
timer.start();
}
}

class JCAction implements ActionListener { // 显示分类图片事件
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
File[] files = new File[50];
String address = null;
for (int i = 0; i < imageLabel.length; i++) {
imageLabel[i].setIcon(null);
imageLabel[i].setBorder(null);
}
if (source == b1) {
address = "分类一.txt";
}
if (source == b2) {
address = "分类二.txt";
}
if (source == b3) {
address = "分类三.txt";
}
if (source == b4) {
address = "分类四.txt";
}
try {
String[] path = read(address);
for (int i = 0; i < path.length; i++) {
files[i] = new File(path[i]);
}
files2 = files;
for (int i = 0; i < path.length; i++) {
imageLabel[i].setIcon(new ImageIcon(files2[i].toString()));
imageLabel[i].addMouseListener(new MouseAction());
imageLabel[i].setName(String.valueOf(i));
resizeIcon(new ImageIcon(files2[i].toString()),
imageLabel[i]);
}
} catch (Exception e1) {
e1.printStackTrace();
}
}
}

class StartListener implements ActionListener {             // 幻灯片手动播放模式实现
public void actionPerformed(ActionEvent e) {
JFrame f = new JFrame("手动播放");
JPanel j = new JPanel();
final JButton big = new JButton("放大");
final JButton small = new JButton("缩小");
final JButton down = new JButton("下一张");
final int index = 0;

down.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ee) {
if (timer != null) {
timer.start();
}
}
});
big.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ee) {
if (timer1 != null) {
timer1.start();
}
}
});
small.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ee) {
if (timer2 != null) {
timer2.start();
}
}
});
f.setSize(800, 600);
f.setLocation(300, 50);timer.stop();
f.setVisible(true);
Container c = f.getContentPane();
c.add(new JScrollPane(jimageLabel));
j.add(big);
j.add(small);
j.add(down);
c.add(j, "South");
if (files2.length == 0)
return;
timer = null;
timer = new Timer(200, new ActionListener() {
int index=-1,width=750,height=600;
public void actionPerformed(ActionEvent el) {
index++;
index%=files2.length;
jimageLabel.setIcon(new ImageIcon(new
ImageIcon(files2[index].toString()).getImage().getScaledInstance(750,
600, Image.SCALE_SMOOTH)));
timer1=null;
timer1 = new Timer(200, new ActionListener() {
public void actionPerformed(ActionEvent el) {
width*=1.1;height*=1.1;
jimageLabel.setIcon(new ImageIcon(new
ImageIcon(files2[index].toString()).getImage().getScaledInstance(width,
height, Image.SCALE_SMOOTH)));
timer1.stop();
}
});
timer2 = new Timer(200, new ActionListener() {
public void actionPerformed(ActionEvent el) {
width/=1.1;height/=1.1;
jimageLabel.setIcon(new ImageIcon(new
ImageIcon(files2[index].toString()).getImage().getScaledInstance(width,height, Image.SCALE_SMOOTH)));
timer2.stop();
}
});
width=750;height=600;
timer.stop();
}
});
timer.start();
}
}

class Listener extends FileStartListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
t++;
timer.setDelay(t * 500);
}
}


//11.
class Listener1 extends FileStartListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
t--;
if(t==0)
t=1;
timer.setDelay(t * 500);
}
}
//12.
class ColourListener implements ActionListener{
public void actionPerformed(ActionEvent e) {
JFrame f = new JFrame();
JPanel j = new JPanel();
f.setSize(800, 600);
f.setLocation(300, 50);
f.setVisible(true);
Container c = f.getContentPane();
final JButton big = new JButton("粘贴");
j.add(big);
c.add(j, "South");
c.add(new JScrollPane(jimageLabel));
big.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ee) {
jimageLabel.setIcon(new ImageIcon(new
ImageIcon(pt).getImage().getScaledInstance(750,
600, Image.SCALE_SMOOTH)));
}
});
}
}



public String[] read(String address) throws Exception {                     // 读地址操作
int i = 0;
String[] path = new String[80];
BufferedReader reader = new BufferedReader(new FileReader(new File(
address)));
while ((path[i++] = reader.readLine()) != null)
;
reader.close();
String[] p = new String[i - 1];
for (int j = 0; j < p.length; j++) {
p[j] = path[j];
}
return p;
}
public void save(String path, String address) throws Exception { // txt.格式保存文件路径
File file = new File(address);
path = path + "\r\n";
try {
if (!file.exists())
file.createNewFile();
FileOutputStream fos = new FileOutputStream(file, true);
fos.write(path.getBytes());
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public void unzip(String ars, String address) throws IOException {
@SuppressWarnings("resource")
ZipFile zf = new ZipFile(ars);
@SuppressWarnings("rawtypes")
Enumeration ent = zf.entries();
while (ent.hasMoreElements()) {
ZipEntry entry = (ZipEntry) ent.nextElement();
InputStream in = zf.getInputStream(entry);
BufferedOutputStream out = new BufferedOutputStream(
new FileOutputStream(address + "/" + entry.getName()));
byte[] b = new byte[8 * 1024];
int len = 0;
while ((len = in.read(b)) != -1) {
out.write(b, 0, len);
}
in.close();
out.close();
}
}
public void resizeIcon(ImageIcon originalIcon, JLabel jlb) {
ImageIcon icon = originalIcon;
icon = new ImageIcon(originalIcon.getImage().getScaledInstance(150,
120, Image.SCALE_SMOOTH));
jlb.setIcon(icon);
}
public void deleteFile(File file) {
if (file.exists()) {
if (file.isFile()) {
file.delete();
} else if (file.isDirectory()) {
File files[] = file.listFiles();
for (int i = 0; i < files.length; i++) {
this.deleteFile(files[i]);
}}
file.delete();}}
public static void main(String args[]) throws Exception {
pictureWatcher a = new pictureWatcher();}}
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
import java.awt.*; import java.awt.event.*; import java.applet.*; import java.net.*; import java.io.*; public class SR_Slider extends Frame implements ActionListener, WindowListener, Runnable { public static void main(String Pagli[]) { new SR_Slider(); } Thread time; //new thread File fl; URL dir; MediaTracker mt; //here you can use an array Image p1, p2, p3, p4, p5, p6, p7; About ab; //instance of About class Panel bottom; AudioClip b_n, rfs; Toolkit tk; Dimension dim; Button back, next, refresh, auto, abt, ext; Color sky; Font f; int count, x; public SR_Slider() { setTitle("SR-Slider 1.0"); setLayout(new BorderLayout()); bottom = new Panel(); time = new Thread(this); sky = new Color(0,140,255); //color - skyblue f = new Font("Courier",Font.BOLD,16); count = 0; x = 0; mt=new MediaTracker(this); try { //getting all images and add them to the MediaTracker p1 = Toolkit.getDefaultToolkit().getImage("Image/p1.jpg"); mt.addImage(p1, 0); p2 = Toolkit.getDefaultToolkit().getImage("Image/p2.jpg"); mt.addImage(p2, 1); p3 = Toolkit.getDefaultToolkit().getImage("Image/p3.jpg"); mt.addImage(p3, 2); p4 = Toolkit.getDefaultToolkit().getImage("Image/p4.jpg"); mt.addImage(p4, 3); p5 = Toolkit.getDefaultToolkit().getImage("Image/p5.jpg"); mt.addImage(p5, 4); p6 = Toolkit.getDefaultToolkit().getImage("Image/p6.jpg"); mt.addImage(p6, 5); p7 = Toolkit.getDefaultToolkit().getImage("Image/p7.jpg"); mt.addImage(p7, 6); fl = new File("user.dir"); dir = fl.toURL(); b_n = Applet.newAudioClip(new URL(dir, "Sound/bk_nxt.au")); rfs = Applet.newAudioClip(new URL(dir, "Sound/rfsh.au")); } catch(MalformedURLException e) { //do nothing! } //designing back button back=new Button("Back"); back.setFont(f); back.setBackground(sky); back.setForeground(Color.white); //designing next button next=new Button("Next"); next.setFont(f); next.setBackground(sky); next.setForeground(Color.white); //designing refresh button refresh=new Button("Reset"); refresh.setFont(f); refresh.setBackground(sky); refresh.setForeground(Color.white); //designing auto button auto=new Button("SlideShow"); auto.setFont(f); auto.setBackground(sky); auto.setForeground(Color.white); //designing abt button abt=new Button("About"); abt.setFont(f); abt.setBackground(sky); abt.setForeground(Color.white); //designing ext button ext=new Button("Exit"); ext.setFont(f); ext.setBackground(sky); ext.setForeground(Color.white); //adding ActionListener to all buttons back.addActionListener(this); next.addActionListener(this); refresh.addActionListener(this); auto.addActionListener(this); abt.addActionListener(this); ext.addActionListener(this); //adding all components to the Frame bottom.add(back); bottom.add(next); bottom.add(refresh); bottom.add(auto); bottom.add(abt); bottom.add(ext); add(bottom, BorderLayout.SOUTH); addWindowListener(this); tk = this.getToolkit(); dim = tk.getScreenSize(); //getting the current screen resolution setBounds(dim.width/6, dim.height/6, 540, 420); setResizable(false); setVisible(true); } public void paint(Graphics g) { if(count < 1) g.drawImage(p1, 0, 0, this); if(count == 1) g.drawImage(p2, 0, 0, this); if(count == 2) g.drawImage(p3, 0, 0, this); if(count == 3) g.drawImage(p4, 0, 0, this); if(count == 4) g.drawImage(p5, 0, 0, this); if(count == 5) g.drawImage(p6, 0, 0, this); if(count == 6) g.drawImage(p7, 0, 0, this); } public void update(Graphics g) { paint(g); } public void actionPerformed(ActionEvent ae) { if(ae.getSource() == ext) { dispose(); setVisible(false); System.exit(0); } if(ae.getSource() == next) { b_n.play(); if(count < 7) { count++; repaint(); } } if(ae.getSource() == back) { b_n.play(); if(count == 0) count=0; if(count > 0) { count--; repaint(); } } if(ae.getSource() == refresh) { rfs.play(); time.suspend(); //suspends the thread count=0; repaint(); } if(ae.getSource() == auto) { b_n.play(); if(x < 1) { time.start(); x++; } else { time.resume(); //resumes the thread } } if(ae.getSource() == abt) { ab = new About(); } } public void run() { try { for(int i=1;i>0;i++) { b_n.play(); time.sleep(3000); count++; if(count > 6) { time.suspend(); //suspends the thread count = 0; } repaint(); } } catch(InterruptedException e) { //do nothing! } } //handling window events public void windowClosing(WindowEvent we) { dispose(); setVisible(false); System.exit(0); } public void windowClosed(WindowEvent we) { //do nothing! } public void windowOpened(WindowEvent we) { //do nothing! } public void windowActivated(WindowEvent we) { //do nothing! } public void windowDeactivated(WindowEvent we) { //do nothing! } public void windowIconified(WindowEvent we) { //do nothing! } public void windowDeiconified(WindowEvent we) { //do nothing! } class About extends Frame implements WindowListener { Font f, f2; private About() { setTitle("About"); setLayout(new FlowLayout()); f = new Font("Verdana", Font.BOLD, 20); f2 = new Font("Verdana", Font.PLAIN, 12); addWindowListener(this); tk = this.getToolkit(); dim = tk.getScreenSize(); //getting the current screen resolution setBounds(dim.width/4, dim.height/4, 300, 190); setResizable(false); setVisible(true); } public void paint(Graphics g) { g.setColor(Color.red); g.setFont(f); g.drawString("SR-Slider 1.0", 10, 60); g.setColor(Color.black); g.setFont(f2); g.drawString("Author: 雪碧的朋友", 10, 90); g.drawString("email:jing_feng70@163.com", 10, 110); g.drawString("谢谢使用", 10, 130); g.drawString("(C) ShuvoRim Pvt. Ltd.", 10, 150); g.drawString("All rights reserved.", 10, 170); } //handling window events public void windowClosing(WindowEvent we) { dispose(); setVisible(false); } public void windowClosed(WindowEvent we) { //do nothing! } public void windowOpened(WindowEvent we) { //do nothing! } public void windowActivated(WindowEvent we) { //do nothing! } public void windowDeactivated(WindowEvent we) { //do nothing! } public void windowIconified(WindowEvent we) { //do nothing! } public void windowDeiconified(WindowEvent we) { //do nothing! } } }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

GodOuO

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值