• jpcap.dll + jpacap.jar + JpcapSetup-0.7.exe +WinPcap_4_1_2.exe

    jpcap安装需要的全部软件。

    5
    300
    1.06MB
    2013-07-19
    9
  • java 写的 qq软件 客户端 服务端

    public class ChatClient extends JFrame implements ActionListener{ String ip = "127.0.0.1";//连接到服务端的ip地址 int port = 8888;//连接到服务端的端口号 String userName = "匆匆过客";//用户名 int type = 0;//0表示未连接,1表示已连接 Image icon;//程序图标 JComboBox combobox;//选择发送消息的接受者 JTextArea messageShow;//客户端的信息显示 JScrollPane messageScrollPane;//信息显示的滚动条 JLabel express,sendToLabel,messageLabel ; JTextField clientMessage;//客户端消息的发送 JCheckBox checkbox;//悄悄话 JComboBox actionlist;//表情选择 JButton clientMessageButton;//发送消息 JTextField showStatus;//显示用户连接状态 Socket socket; ObjectOutputStream output;//网络套接字输出流 ObjectInputStream input;//网络套接字输入流 ClientReceive recvThread; //建立菜单栏 JMenuBar jMenuBar = new JMenuBar(); //建立菜单组 JMenu operateMenu = new JMenu ("操作(O)"); //建立菜单项 JMenuItem loginItem = new JMenuItem ("用户登录(I)"); JMenuItem logoffItem = new JMenuItem ("用户注销(L)"); JMenuItem exitItem=new JMenuItem ("退出(X)"); JMenu conMenu=new JMenu ("设置(C)"); JMenuItem userItem=new JMenuItem ("用户设置(U)"); JMenuItem connectItem=new JMenuItem ("连接设置(C)"); JMenu helpMenu=new JMenu ("帮助(H)"); JMenuItem helpItem=new JMenuItem ("帮助(H)"); //建立工具栏 JToolBar toolBar = new JToolBar(); //建立工具栏中的按钮组件 JButton loginButton;//用户登录 JButton logoffButton;//用户注销 JButton userButton;//用户信息的设置 JButton connectButton;//连接设置 JButton exitButton;//退出按钮 //框架的大小 Dimension faceSize = new Dimension(400, 600); JPanel downPanel ; GridBagLayout girdBag; GridBagConstraints girdBagCon; public ChatClient(){ init();//初始化程序 //添加框架的关闭事件处理 this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.pack(); //设置框架的大小 this.setSize(faceSize); //设置运行时窗口的位置 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation( (int) (screenSize.width - faceSize.getWidth()) / 2, (int) (screenSize.height - faceSize.getHeight()) / 2); this.setResizable(false); this.setTitle("聊天室客户端"); //设置标题 //程序图标 icon = getImage("icon.gif"); this.setIconImage(icon); //设置程序图标 show(); //为操作菜单栏设置热键'V' operateMenu.setMnemonic('O'); //为用户登录设置快捷键为ctrl+i loginItem.setMnemonic ('I'); loginItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_I,InputEvent.CTRL_MASK)); //为用户注销快捷键为ctrl+l logoffItem.setMnemonic ('L'); logoffItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_L,InputEvent.CTRL_MASK)); //为退出快捷键为ctrl+x exitItem.setMnemonic ('X'); exitItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_X,InputEvent.CTRL_MASK)); //为设置菜单栏设置热键'C' conMenu.setMnemonic('C'); //为用户设置设置快捷键为ctrl+u userItem.setMnemonic ('U'); userItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_U,InputEvent.CTRL_MASK)); //为连接设置设置快捷键为ctrl+c connectItem.setMnemonic ('C'); connectItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_C,InputEvent.CTRL_MASK)); //为帮助菜单栏设置热键'H' helpMenu.setMnemonic('H'); //为帮助设置快捷键为ctrl+p helpItem.setMnemonic ('H'); helpItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_H,InputEvent.CTRL_MASK)); } /** * 程序初始化函数 */ public void init(){ Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //添加菜单栏 operateMenu.add (loginItem); operateMenu.add (logoffItem); operateMenu.add (exitItem); jMenuBar.add (operateMenu); conMenu.add (userItem); conMenu.add (connectItem); jMenuBar.add (conMenu); helpMenu.add (helpItem); jMenuBar.add (helpMenu); setJMenuBar (jMenuBar); //初始化按钮 loginButton = new JButton("登录"); logoffButton = new JButton("注销"); userButton = new JButton("用户设置" ); connectButton = new JButton("连接设置" ); exitButton = new JButton("退出" ); //当鼠标放上显示信息 loginButton.setToolTipText("连接到指定的服务器"); logoffButton.setToolTipText("与服务器断开连接"); userButton.setToolTipText("设置用户信息"); connectButton.setToolTipText("设置所要连接到的服务器信息"); //将按钮添加到工具栏 toolBar.add(userButton); toolBar.add(connectButton); toolBar.addSeparator();//添加分隔栏 toolBar.add(loginButton); toolBar.add(logoffButton); toolBar.addSeparator();//添加分隔栏 toolBar.add(exitButton); contentPane.add(toolBar,BorderLayout.NORTH); checkbox = new JCheckBox("悄悄话"); checkbox.setSelected(false); actionlist = new JComboBox(); actionlist.addItem("微笑地"); actionlist.addItem("高兴地"); actionlist.addItem("轻轻地"); actionlist.addItem("生气地"); actionlist.addItem("小心地"); actionlist.addItem("静静地"); actionlist.setSelectedIndex(0); //初始时 loginButton.setEnabled(true); logoffButton.setEnabled(false); //为菜单栏添加事件监听 loginItem.addActionListener(this); logoffItem.addActionListener(this); exitItem.addActionListener(this); userItem.addActionListener(this); connectItem.addActionListener(this); helpItem.addActionListener(this); //添加按钮的事件侦听 loginButton.addActionListener(this); logoffButton.addActionListener(this); userButton.addActionListener(this); connectButton.addActionListener(this); exitButton.addActionListener(this); combobox = new JComboBox(); combobox.insertItemAt("所有人",0); combobox.setSelectedIndex(0); messageShow = new JTextArea(); messageShow.setEditable(false); //添加滚动条 messageScrollPane = new JScrollPane(messageShow, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); messageScrollPane.setPreferredSize(new Dimension(400,400)); messageScrollPane.revalidate(); clientMessage = new JTextField(23); clientMessage.setEnabled(false); clientMessageButton = new JButton(); clientMessageButton.setText("发送"); //添加系统消息的事件侦听 clientMessage.addActionListener(this); clientMessageButton.addActionListener(this); sendToLabel = new JLabel("发送至:"); express = new JLabel(" 表情: "); messageLabel = new JLabel("发送消息:"); downPanel = new JPanel(); girdBag = new GridBagLayout(); downPanel.setLayout(girdBag); girdBagCon = new GridBagConstraints(); girdBagCon.gridx = 0; girdBagCon.gridy = 0; girdBagCon.gridwidth = 5; girdBagCon.gridheight = 2; girdBagCon.ipadx = 5; girdBagCon.ipady = 5; JLabel none = new JLabel(" "); girdBag.setConstraints(none,girdBagCon); downPanel.add(none); girdBagCon = new GridBagConstraints(); girdBagCon.gridx = 0; girdBagCon.gridy = 2; girdBagCon.insets = new Insets(1,0,0,0); //girdBagCon.ipadx = 5; //girdBagCon.ipady = 5; girdBag.setConstraints(sendToLabel,girdBagCon); downPanel.add(sendToLabel); girdBagCon = new GridBagConstraints(); girdBagCon.gridx =1; girdBagCon.gridy = 2; girdBagCon.anchor = GridBagConstraints.LINE_START; girdBag.setConstraints(combobox,girdBagCon); downPanel.add(combobox); girdBagCon = new GridBagConstraints(); girdBagCon.gridx =2; girdBagCon.gridy = 2; girdBagCon.anchor = GridBagConstraints.LINE_END; girdBag.setConstraints(express,girdBagCon); downPanel.add(express); girdBagCon = new GridBagConstraints(); girdBagCon.gridx = 3; girdBagCon.gridy = 2; girdBagCon.anchor = GridBagConstraints.LINE_START; //girdBagCon.insets = new Insets(1,0,0,0); //girdBagCon.ipadx = 5; //girdBagCon.ipady = 5; girdBag.setConstraints(actionlist,girdBagCon); downPanel.add(actionlist); girdBagCon = new GridBagConstraints(); girdBagCon.gridx = 4; girdBagCon.gridy = 2; girdBagCon.insets = new Insets(1,0,0,0); //girdBagCon.ipadx = 5; //girdBagCon.ipady = 5; girdBag.setConstraints(checkbox,girdBagCon); downPanel.add(checkbox); girdBagCon = new GridBagConstraints(); girdBagCon.gridx = 0; girdBagCon.gridy = 3; girdBag.setConstraints(messageLabel,girdBagCon); downPanel.add(messageLabel); girdBagCon = new GridBagConstraints(); girdBagCon.gridx = 1; girdBagCon.gridy = 3; girdBagCon.gridwidth = 3; girdBagCon.gridheight = 1; girdBag.setConstraints(clientMessage,girdBagCon); downPanel.add(clientMessage); girdBagCon = new GridBagConstraints(); girdBagCon.gridx = 4; girdBagCon.gridy = 3; girdBag.setConstraints(clientMessageButton,girdBagCon); downPanel.add(clientMessageButton);

    4
    112
    55KB
    2011-09-03
    15
  • java 端口扫描工具 端口扫描

    public static JFrame main=new JFrame("JAVA端口扫描器"); //显示扫描结果 public static JTextArea Result=new JTextArea("",4,40); //滚动条面板 public static JScrollPane resultPane = new JScrollPane(Result,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //输入主机名文本框 public static JTextField hostname=new JTextField("localhost",8); //输入ip地址前3位的输入框 public static JTextField fromip1=new JTextField("0",3); //输入ip地址4~6位的输入框 public static JTextField fromip2=new JTextField("0",3); //输入ip地址7~9位的输入框 public static JTextField fromip3=new JTextField("0",3); //输入起始ip地址最后4位的输入框 public static JTextField fromip4=new JTextField("0",3); //输入目标ip地址最后4位的输入框 public static JTextField toip=new JTextField("0",3); //输入最小端口的输入框 public static JTextField minPort=new JTextField("0",4); //输入最大端口的输入框 public static JTextField maxPort=new JTextField("1000",4); //输入最大线程数量的输入框 public static JTextField maxThread=new JTextField("100",3); //错误提示框 public static JDialog DLGError=new JDialog(main,"错误!"); public static JLabel DLGINFO=new JLabel(""); public static JLabel type=new JLabel("请选择:"); //扫描类型 public static JRadioButton radioIp = new JRadioButton("IP地址:"); public static JRadioButton radioHost = new JRadioButton("主机名:",true); //单选框组 public static ButtonGroup group = new ButtonGroup(); public static JLabel P1=new JLabel("端口范围:"); public static JLabel P2=new JLabel("~"); public static JLabel P3=new JLabel("~"); public static JLabel Pdot1 = new JLabel("."); public static JLabel Pdot2 = new JLabel("."); public static JLabel Pdot3 = new JLabel("."); public static JLabel TNUM=new JLabel("线程数:"); public static JLabel RST=new JLabel("扫描结果: "); public static JLabel con=new JLabel(" "); //定义按钮 public static JButton OK = new JButton("确定"); public static JButton Submit = new JButton("开始扫描"); public static JButton Cancel = new JButton("退出"); public static JButton saveButton = new JButton("保存扫描结果"); //菜单栏 public static JMenuBar myBar = new JMenuBar(); public static JMenu myMenu = new JMenu("文件(F)"); public static JMenuItem saveItem = new JMenuItem("保存扫描结果(S)"); public static JMenuItem exitItem = new JMenuItem("退出(Q)"); public static JMenu myMenu2 = new JMenu("帮助"); public static JMenuItem helpItem = new JMenuItem("阅读"); public static void main(String[] args){ main.setSize(500,400); main.setLocation(300,300); main.setResizable(false); main.setLayout(new GridBagLayout()); main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); DLGError.setSize(300,100); DLGError.setLocation(400,400); //添加“菜单栏” myMenu.add(saveItem); myMenu.add(exitItem); myMenu2.add(helpItem); myBar.add(myMenu); myBar.add(myMenu2); main.setJMenuBar(myBar); //设置热键 myMenu.setMnemonic('F'); saveItem.setMnemonic ('S'); //为“另存为”组件设置快捷键为ctrl+s saveItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_S,InputEvent.CTRL_MASK)); exitItem.setMnemonic('Q'); exitItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_E,InputEvent.CTRL_MASK)); //采用表格包型布局 Container mPanel = main.getContentPane(); GridBagConstraints c = new GridBagConstraints(); c.insets = new Insets(10,0,0,10); c.gridx = 0; c.gridy = 0; c.gridwidth = 10; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(type,c); group.add(radioIp); group.add(radioHost); c.gridx = 0; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(radioIp,c); c.gridx = 1; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(fromip1,c); c.gridx = 2; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(Pdot1,c); c.gridx = 3; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(fromip2,c); c.gridx = 4; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(Pdot2,c); c.gridx = 5; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(fromip3,c); c.gridx = 6; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(Pdot3,c); c.gridx = 7; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(fromip4,c); c.gridx = 8; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(P2,c); c.gridx = 9; c.gridy = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(toip,c); c.gridx = 0; c.gridy = 2; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(radioHost,c); c.gridx = 1; c.gridy = 2; c.gridwidth = 3; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(hostname,c); c.gridx = 0; c.gridy = 3; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(P1,c); c.gridx = 1; c.gridy = 3; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(minPort,c); c.gridx = 2; c.gridy = 3; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(P3,c); c.gridx = 3; c.gridy = 3; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(maxPort,c); c.gridx = 0; c.gridy = 4; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(TNUM,c); c.gridx = 1; c.gridy = 4; c.gridwidth = 3; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; mPanel.add(maxThread,c);

    5
    533
    28KB
    2011-09-03
    27
  • java 蜘蛛纸牌源代码以及可运行的jar包

    //整型变量,表示难度等级为:简单 public static final int EASY = 1; //整型变量,表示难度等级为:普通 public static final int NATURAL = 2; //整型变量,表示难度等级为:难 public static final int HARD = 3; //设定初始难度等级为简单 private int grade = Spider.EASY; private Container pane = null; //生成纸牌数组 private PKCard cards[] = new PKCard[104]; private JLabel clickLabel = null; private int c = 0; private int n = 0; private int a = 0; private int finish = 0; Hashtable table = null; private JLabel groundLabel[] = null; public static void main(String[] args){ Spider spider = new Spider(); spider.setVisible(true); } /** **构造函数 */ public Spider(){ setTitle("蜘蛛牌"); setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); //设置框架的大小 setSize(1024, 742); //生成SpiderMenuBar对象,并放置在框架之上 setJMenuBar(new SpiderMenuBar(this)); pane = this.getContentPane(); //设置背景颜色 pane.setBackground(new Color(0, 112, 26)); //将布局管理器设置成为null pane.setLayout(null); clickLabel = new JLabel(); clickLabel.setBounds(883, 606, 121, 96); pane.add(clickLabel); clickLabel.addMouseListener(new MouseAdapter(){ public void mouseReleased(MouseEvent me){ if (c < 60){ Spider.this.deal(); } } }); this.initCards(); this.randomCards(); this.setCardsLocation(); groundLabel = new JLabel[10]; int x = 20; for (int i = 0; i < 10; i++) { groundLabel[i] = new JLabel(); groundLabel[i] .setBorder(javax.swing.BorderFactory .createEtchedBorder(javax.swing.border.EtchedBorder.RAISED)); groundLabel[i].setBounds(x, 25, 71, 96); x += 101; this.pane.add(groundLabel[i]); } this.setVisible(true); this.deal(); this.addKeyListener(new KeyAdapter(){ class Show extends Thread{ public void run(){ Spider.this.showEnableOperator(); } } public void keyPressed(KeyEvent e){ if (finish != 8) if (e.getKeyCode() == KeyEvent.VK_D && c < 60){ Spider.this.deal(); } else if (e.getKeyCode() == KeyEvent.VK_M){ new Show().start(); } } }); } /** **开始新游戏 */ public void newGame(){ this.randomCards(); this.setCardsLocation(); this.setGroundLabelZOrder(); this.deal(); } /** **返回值:int **返回牌的数量 */ public int getC(){ return c; } /** **设置等级 */ public void setGrade(int grade){ this.grade = grade; } /** **纸牌初始化 */ public void initCards(){ //如果纸牌已被赋值,即将其从框架的面板中移去 if (cards[0] != null){ for (int i = 0; i < 104; i++){ pane.remove(cards[i]); } } int n = 0; //通过难度等级,为n赋值 if (this.grade == Spider.EASY){ n = 1; } else if (this.grade == Spider.NATURAL){ n = 2; } else{ n = 4; } //为card赋值 for (int i = 1; i <= 8; i++){ for (int j = 1; j <= 13; j++){ cards[(i - 1) * 13 + j - 1] = new PKCard((i % n + 1) + "-" + j, this); } } //随机纸牌初始化 this.randomCards(); } /** **纸牌随机分配 */ public void randomCards(){ PKCard temp = null; //随机生成牌号 for (int i = 0; i < 52; i++){ int a = (int) (Math.random() * 104); int b = (int) (Math.random() * 104); temp = cards[a]; cards[a] = cards[b]; cards[b] = temp; } }

    5
    201
    133KB
    2011-09-03
    11
  • java 写的浏览器 源代码

    public class WebBrowser extends JFrame implements HyperlinkListener,ActionListener{ //建立工具栏用来显示地址栏 JToolBar bar=new JToolBar (); //建立网页显示界面 JTextField jurl = new JTextField (60); JEditorPane jEditorPane1 = new JEditorPane (); JScrollPane scrollPane = new JScrollPane (jEditorPane1); JFileChooser chooser=new JFileChooser (); JFileChooser chooser1=new JFileChooser (); String htmlSource; JWindow window = new JWindow (WebBrowser.this); JButton button2=new JButton ("窗口还原"); Toolkit toolkit = Toolkit.getDefaultToolkit(); //建立菜单栏 JMenuBar jMenuBar1 = new JMenuBar(); //建立菜单组 JMenu fileMenu = new JMenu ("文件(F)"); //建立菜单项 JMenuItem saveAsItem = new JMenuItem ("另存为(A)..."); JMenuItem exitItem=new JMenuItem ("退出(I)"); JMenu editMenu=new JMenu ("编辑(E)"); JMenuItem backItem=new JMenuItem ("后退"); JMenuItem forwardItem=new JMenuItem ("前进"); JMenu viewMenu=new JMenu ("视图(V)"); JMenuItem fullscreenItem=new JMenuItem ("全屏(U)"); JMenuItem sourceItem=new JMenuItem ("查看源码(C)"); JMenuItem reloadItem=new JMenuItem ("刷新(R)"); //建立工具栏 JToolBar toolBar = new JToolBar(); //建立工具栏中的按钮组件 JButton picSave = new JButton("另存为"); JButton picBack = new JButton("后退"); JButton picForward = new JButton("前进"); JButton picView = new JButton("查看源代码"); JButton picExit = new JButton("退出"); JLabel label=new JLabel ("地址"); JButton button=new JButton ("转向"); Box adress=Box.createHorizontalBox (); //ArrayList对象,用来存放历史地址 private ArrayList history=new ArrayList(); //整型变量,表示历史地址的访问顺序 private int historyIndex; /** **构造函数 **初始化图形用户界面 */ public WebBrowser(){ setTitle ("网页浏览器"); setResizable(false); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //为jEditorPane1添加事件侦听 jEditorPane1.addHyperlinkListener (this); //为组件fileMenu设置热键‘F’ fileMenu.setMnemonic('F'); saveAsItem.setMnemonic ('S'); //为“另存为”组件设置快捷键为ctrl+s saveAsItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_S,InputEvent.CTRL_MASK)); exitItem.setMnemonic('Q'); exitItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_E,InputEvent.CTRL_MASK)); //将菜单项saveAsItem加入到菜单组fileMenu中 fileMenu.add (saveAsItem); //在菜单项中添加隔离 fileMenu.addSeparator (); fileMenu.add (exitItem); backItem.setMnemonic ('B'); backItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_Z,InputEvent.CTRL_MASK)); forwardItem.setMnemonic('D'); forwardItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_P,InputEvent.CTRL_MASK)); editMenu.setMnemonic('E'); editMenu.add (backItem); editMenu.add (forwardItem); viewMenu.setMnemonic('V'); fullscreenItem.setMnemonic('U'); fullscreenItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_U,InputEvent.CTRL_MASK)); sourceItem.setMnemonic('C'); sourceItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_C,InputEvent.CTRL_MASK)); reloadItem.setMnemonic('R'); reloadItem.setAccelerator (KeyStroke.getKeyStroke (KeyEvent.VK_R,InputEvent.CTRL_MASK)); Container contentPane=getContentPane (); //设置大小 scrollPane.setPreferredSize(new Dimension(100,500)); contentPane.add (scrollPane, BorderLayout.SOUTH); //在工具栏中添加按钮组件 toolBar.add(picSave); toolBar.addSeparator(); toolBar.add(picBack); toolBar.add(picForward); toolBar.addSeparator(); toolBar.add(picView); toolBar.addSeparator(); toolBar.add(picExit); contentPane.add (bar,BorderLayout.CENTER); contentPane.add(toolBar,BorderLayout.NORTH); viewMenu.add (fullscreenItem); viewMenu.add (sourceItem); viewMenu.addSeparator (); viewMenu.add (reloadItem); jMenuBar1.add (fileMenu); jMenuBar1.add (editMenu); jMenuBar1.add (viewMenu); setJMenuBar (jMenuBar1); adress.add (label); adress.add (jurl); adress.add (button); bar.add (adress); //为组件添加事件监听 saveAsItem.addActionListener(this); picSave.addActionListener(this); exitItem.addActionListener(this); picExit.addActionListener(this); backItem.addActionListener(this); picBack.addActionListener(this); forwardItem.addActionListener(this); picForward.addActionListener(this); fullscreenItem.addActionListener(this); sourceItem.addActionListener(this); picView.addActionListener(this); reloadItem.addActionListener(this); button.addActionListener(this); jurl.addActionListener(this); }

    4
    154
    15KB
    2011-09-03
    9
  • java 计算器

    JFrame frame=new JFrame("计算器"); JPanel panel1=new JPanel(); JPanel panel2=new JPanel(); JButton btn0=new JButton("0"); JButton btn1=new JButton("1"); JButton btn2=new JButton("2"); JButton btn3=new JButton("3"); JButton btn4=new JButton("4"); JButton btn5=new JButton("5"); JButton btn6=new JButton("6"); JButton btn7=new JButton("7"); JButton btn8=new JButton("8"); JButton btn9=new JButton("9"); JButton jia=new JButton("+"); JButton jian=new JButton("-"); JButton cheng=new JButton("x"); JButton chu=new JButton("/"); JButton dengyu=new JButton("="); JButton qingchu=new JButton("C");

    4
    83
    4KB
    2011-09-03
    9
  • 日期操作类 java

    // 格式:年-月-日 小时:分钟:秒 public static final String FORMAT_ONE = "yyyy-MM-dd HH:mm:ss"; // 格式:年-月-日 小时:分钟 public static final String FORMAT_TWO = "yyyy-MM-dd HH:mm"; // 格式:年月日 小时分钟秒 public static final String FORMAT_THREE = "yyyyMMdd-HHmmss"; // 格式:年-月-日 public static final String LONG_DATE_FORMAT = "yyyy-MM-dd"; // 格式:月-日 public static final String SHORT_DATE_FORMAT = "MM-dd"; // 格式:小时:分钟:秒 public static final String LONG_TIME_FORMAT = "HH:mm:ss"; //格式:年-月 public static final String MONTG_DATE_FORMAT = "yyyy-MM"; // 年的加减 public static final int SUB_YEAR = Calendar.YEAR; // 月加减 public static final int SUB_MONTH = Calendar.MONTH; // 天的加减 public static final int SUB_DAY = Calendar.DATE; // 小时的加减 public static final int SUB_HOUR = Calendar.HOUR; // 分钟的加减 public static final int SUB_MINUTE = Calendar.MINUTE; // 秒的加减 public static final int SUB_SECOND = Calendar.SECOND; static final String dayNames[] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; @SuppressWarnings("unused") private static final SimpleDateFormat timeFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); public DateUtil() {

    4
    138
    16KB
    2011-09-03
    9
  • java文件操作类

    java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类java文件操作类

    5
    119
    6KB
    2011-09-03
    10
  • 数据库操作类

    数据库操作类

    0
    32
    8KB
    2011-08-29
    0
  • c# 三层架构 架构 asp.net

    c# 三层架构 架构 asp.net c# 三层架构 架构 asp.net c# 三层架构 架构 asp.net c# 三层架构 架构 asp.net c# 三层架构 架构 asp.net c# 三层架构 架构 asp.net c# 三层架构 架构 asp.net

    4
    140
    904KB
    2011-08-29
    9
  • 笔耕不辍

    累计1年每年原创文章数量>=20篇
关注 私信
上传资源赚积分or赚钱