第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

文件上傳問(wèn)題

文件上傳問(wèn)題

cute倩影O_o 2016-12-11 20:37:49
?import?javax.swing.*;import?javax.swing.table.DefaultTableModel;import?org.omg.CORBA.portable.InputStream;import?java.awt.*;import?java.awt.event.ActionEvent;import?java.awt.event.ActionListener;import?java.io.File;import?java.text.SimpleDateFormat;import?java.util.Vector;import?java.io.*;public?class?photos1?extends?JFrame?implements?ActionListener?{ File?files[]; File?f; private?JLabel?ss;//照片標(biāo)簽 JTextField?wen?=?new?JTextField("圖片名稱(chēng)"); JButton?b1?=?new?JButton("搜索圖片"); JButton?b2?=?new?JButton("添加圖片"); JButton?b3?=?new?JButton("刪除圖片"); private?DefaultTableModel?table; JTable?biao=new?JTable(); String?title[]={"名稱(chēng)","大小","類(lèi)型","時(shí)間"}; public?photos1(){ super("相冊(cè)管理系統(tǒng)主界面"); this.setSize(600,?400); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); JPanel?jp?=?new?JPanel(); JPanel?jp1?=?new?JPanel(); JPanel?jp2?=?new?JPanel(); JMenuBar?caidan?=?new?JMenuBar(); JMenu?File?=?new?JMenu("文件(F)"); JMenu?View?=?new?JMenu("查看(V)"); JMenu?Help?=?new?JMenu("幫助(H)"); JMenuItem?Save?=?new?JMenuItem("保存"); JMenuItem?xi?=?new?JMenuItem("圖片信息"); JMenuItem?Aboult?=?new?JMenuItem("關(guān)于"); caidan.add(File); caidan.add(View); caidan.add(Help); this.add(caidan,?"North"); File.add(Save); View.add(xi); Help.add(Aboult); xi.addActionListener(this); jp.setLayout(new?GridLayout(4,?4,?20,?50)); jp2.add(jp,?"North"); jp.add(wen); jp.add(b1); jp.add(b2); jp.add(b3); this.add(jp2,?"West"); this.add(jp1,?"Center"); this.table=new?DefaultTableModel(title,20); this.biao=new?JTable(this.table); jp1.add(new?JScrollPane(this.biao),"Center"); b1.addActionListener(this); Aboult.addActionListener(this); this.f=new?File("photos"); String?path=this.f.getPath(); this.f=new?File(path); ImageIcon?aa?=?new?ImageIcon(photos1.class.getResource("lq.jpg")); ss?=?new?JLabel(aa); ss.setBounds(0,?0,?600,?400); this.getLayeredPane().add(ss,?new?Integer(Integer.MIN_VALUE)); jp.setOpaque(false); jp1.setOpaque(false); jp2.setOpaque(false); caidan.setOpaque(false); ((JPanel)?this.getContentPane()).setOpaque(false); this.setVisible(true); } ?private?void?listFilesToTableModle(){ ???? this.files=this.f.listFiles(); ???? SimpleDateFormat?sdf=new?SimpleDateFormat("yyyy-MM-DD?hh:mm"); ???? for(int?i=0;i<this.files.length;i++) ???? {this.table.setValueAt(this.files[i].getName(),i,0); ???? //if(this。files[i].isFile?()) ??????this.table.setValueAt(this.files[i].length()+"B",i,?1); ??????if(this.files[i].isDirectory()) ???? ??this.table.setValueAt("jpg",?i,?2); ?????//?String?d?=sdf.format(new?Date(files[i].lastModified()));??????????? }???? } @Override public?void?actionPerformed(ActionEvent?ee)?{ JOptionPane.showMessageDialog(null,?"您好歡迎使用相冊(cè)管理系統(tǒng)!????請(qǐng)輸入圖片的名字進(jìn)行使用????例如:“1.jpg”",?"Aboult", JOptionPane.INFORMATION_MESSAGE); //else?if(ee.getSource()==this.f) ?//this.f=((JLabel)?new?File(?this.f)).getText()); //?TODO?Auto-generated?method?stub } public?static?void?main(String[]?args)?{ //主界面 new?photos1(); }}我用鏈表導(dǎo)入圖片信息,可是什么都不顯示
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1606 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)