专业语言:简易图片浏览器
百度广告
/**
* @author new
import java.awt.event.*;
import java.awt.*;
public class PictureFrame extends javax.swing.JFrame {
/** Creates new form PictureFrame */
initComponents();
* initialize the form.
* always regenerated by the Form Editor.
//
jPopupMenu1 = new javax.swing.JPopupMenu();
jLabel1 = new javax.swing.JLabel();
jButton2 = new javax.swing.JButton();
jMenu1 = new javax.swing.JMenu();
jMenuItem2 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem6 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(255, 255, 255));
setMaximizedBounds(new java.awt.Rectangle(100, 200, 800, 800));
jPanel2.setEnabled(false);
jLabel1.setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(255, 0, 0)));
jButton1.setText(""u7ee7"u7eed"u6d4f"u89c8");
public void actionPerformed(java.awt.event.ActionEvent evt) {
}
jButton2.setText(""u53d6"u6d88"u6d4f"u89c8");
public void mouseClicked(java.awt.event.MouseEvent evt) {
}
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2Layout.setHorizontalGroup(
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 417, Short.MAX_VALUE)
.addGap(88, 88, 88)
.addGap(60, 60, 60)
.addContainerGap(107, Short.MAX_VALUE))
jPanel2Layout.setVerticalGroup(
.addGroup(jPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1)
.addContainerGap())
jMenu1.setText(""u6587"u4ef6(F)");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
MenuItem1Listener(evt);
});
jMenu1.add(jMenuItem1);
jMenuItem2.setText(""u6253"u5f00(O)");
public void actionPerformed(java.awt.event.ActionEvent evt) {
}
jMenu1.add(jMenuItem2);
jMenuItem4.setText(""u9000"u51fa(E)");
public void actionPerformed(java.awt.event.ActionEvent evt) {
}
jMenu1.add(jMenuItem4);
jMenuBar1.add(jMenu1);
jMenu2.setText(""u5e2e"u52a9(H)");
jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
aboutListener(evt);
});
jMenu2.add(jMenuItem5);
/* jMenuItem6.setText(""u58f0"u660e(Declear)");
public void actionPerformed(java.awt.event.ActionEvent evt) {
}
jMenu2.add(jMenuItem6);*/
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
layout.setHorizontalGroup(
.addGroup(layout.createSequentialGroup()
.addContainerGap(15, Short.MAX_VALUE))
layout.setVerticalGroup(
.addGroup(layout.createSequentialGroup()
.addContainerGap(42, Short.MAX_VALUE))
pack();
// TODO 将在此处添加您的处理代码:
}
private void MenuItem4Listener(java.awt.event.ActionEvent evt) {
System.exit(1);
private void MenuItem2Listener(java.awt.event.ActionEvent evt) {
JFileChooser chooser = new JFileChooser();
filename=chooser.getSelectedFile().getName();
System.out.println(openPath);
jLabel1.setIcon(imag);
private void MenuItem1Listener(java.awt.event.ActionEvent evt) {
ImageIcon imag=new ImageIcon();
}
private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {
System.exit(1);
private void JButton1Listener(java.awt.event.ActionEvent evt) {
File file=new File(openPath);
String str=file.list();
ImageIcon imag=new ImageIcon(openPath+""""+str[i]);
i++;
* @param args the command line arguments
public static void main(String args) {
public void run() {
}
}
// 变量声明 - 不进行修改
private javax.swing.JButton jButton2;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JPanel jPanel2;
private String filename;
private static int i=0;
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>