freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

全國計(jì)算機(jī)等級(jí)考試二級(jí)java語言程序設(shè)計(jì)試題及答案(五)(參考版)

2025-06-22 20:45本頁面
  

【正文】 。   private java. util. List fileList。   else   throw new UnsupportedFlavorException(flavor) 。   }   public Object getTransferData(DataFlavor flavor)   throws UnsupportedFlavorException   if(flavor, equals(DataFlavor, javaFileListFlavor) )   return fileList。   import java.a(chǎn)wt.*;   import java.a(chǎn)wt.datatransfer.*;   import java.a(chǎn)wt.dnd.*;   import java.a(chǎn)wt.event.*;   import java.io.*;   import java.util.*;   import javax.swing.*;   public class java3   {   public static void main(String[]args)   {   JFrame frame=new DragSourceFrame();   frame.setDefauhCloseOperation(JFrame.EXIT_   0N_CLoSE);   frame.show();   }   }   class DragSoureeFrame extends JFrame   {   public DragSourceFrame()   {   setTitle(java3);   setSize(WlDTH,HElGHT);   Container contentPane=getContentPane();   File f=new File(.).getabsoluteFile();   File[]files=f.listFiles();   model=new DefaultListModel();   for(int i=0;i  try   {   model.a(chǎn)ddElement(files[i].getCanonicalFile());   }   catch(IOException exception)   {   JOptionPane.showMessageDialog(this,exeep   tion);   }   fileList=new JList(model);   contentPane.a(chǎn)dd(new JScrollPane(fileList),   BorderLayout.CENTER);   contentPane.a(chǎn)dd(new JLabel(從列表中拖曳出文   件),   BorderLayout.NoRTH);   DragSource dragSource=DragSource.getDefauh   DragSource();   dragSource.createDefaultDragGestureRecognizer   (fileList,   DnDConstants. ACTION_COPY_0R_   MOVE,new   DragGestureListener()   {   public void dragGestureRecognized(   DragGestureEvent event)   {   draggedValues=fileList.getSelectedValues();   Transferable transferable   =new FiteListTransferable(draggedValues);   evenr.startDrag(null,transferable,   new FileListDragSourceListener());   }   });   }   private class FileListDragSourceListener imple   ments DragSourceAdapter   {   public void dragDropEnd(DragSourceDropEvent e   vent)   {   if(event.getDropSuccess())   {   int action=event.getDropAction();   if(action= =DnDConstants.ACTl0N MOVE)   {   for(int i=0;i  model.removeElement(draggedValues[i]);   }   }   }   }   private JList fileList;   private DefauhListModel model;   private Object[]draggedValues;   private static final int WIDTH=300;   private static final int HEIGHT=200;   }   class FileListTransferable implements Transferable   {   public FileListTransferable(Object[]files)   {   fileList=new ArrayList(Arrays.a(chǎn)sList(files));   }   public DataFlavor[]getTransferDataFlavors()   {   return flavors。 綜合應(yīng)用題(共18分)   本題的功能是監(jiān)聽鼠標(biāo)的拖曳操作。   三、簡單應(yīng)用題(共24分)   本題中,主窗口有一個(gè)按鈕“顯示Dial09”,單擊該按鈕后顯示一個(gè)對(duì)話框,對(duì)話框的標(biāo)題是“Dial09”,其上有一個(gè)文字標(biāo)簽“歡迎學(xué)習(xí)Java.”,此時(shí)仍允許對(duì)原來窗口進(jìn)行操作,當(dāng)關(guān)閉新生成的對(duì)話框時(shí)退出程序。程序中調(diào)用add()方法求整數(shù)24和34的和,并將結(jié)果打印輸出。 二、基本操作題(共18分)   本題定義了一個(gè)方法add(),用于求兩個(gè)整形數(shù)的和。   A.進(jìn)入://java.sum.   B.單擊左側(cè)Download鏈接   C.單擊頁面中的Java 2 Platform,Standard Edition鏈接   D.單擊頁面中的J2SE l.4.2鏈接 C?!窘馕觥縅DBC中定義了一組標(biāo)準(zhǔn)的應(yīng)用程序接口(API),這些APl是一種面向?qū)ο蟮姆庋b和重新設(shè)計(jì)的接口,使得用戶能夠編寫不依賴于數(shù)據(jù)庫廠商的數(shù)據(jù)庫應(yīng)用程序。   39.JDBC是面向( )的?!窘馕觥吭贘ava Applet的生命周期中,共有4種狀態(tài)和4個(gè)方法:init()、start()、stop()和destroy()。   38.在Applet生命周期中,下面方法中,在裝載Applet時(shí)被調(diào)用的是( )。在程序段最后有兩個(gè)大括號(hào),
點(diǎn)擊復(fù)制文檔內(nèi)容
高考資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1