⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syslogframe.java

📁 與 unix 上相似的 syslog 沒有log4j 複雜 用戶端 syslog
💻 JAVA
字号:
package com.ice.syslog;import java.awt.*;import java.awt.event.*;import java.util.*;import java.applet.*;classSyslogFrame extends Frame		implements ActionListener	{	private SyslogApplet	applet;		public	SyslogFrame(			String title, SyslogApplet app,			int x, int y, int w, int h )		{		super( title );				this.applet = app;		this.establishMenuBar();		this.applet.init();		this.add( "Center", applet );		this.pack();		this.setLocation( x, y );		this.setSize( w, h );		this.show();		this.applet.start();		this.addWindowListener(			new WindowAdapter()				{				public void				windowClosing(WindowEvent e)					{ shutdown(); }				}			);		}		private void	establishMenuBar()		{        MenuItem	mItem;		MenuBar mbar = new MenuBar();		Menu file = new Menu( "File", true );		mbar.add( file );        mItem = new MenuItem( "Test Message 1" );        mItem.setActionCommand( "TEST1" );        mItem.addActionListener( this );	    file.add( mItem );        mItem = new MenuItem( "Test Message 2" );        mItem.setActionCommand( "TEST2" );        mItem.addActionListener( this );	    file.add( mItem );        mItem = new MenuItem( "Flood 25 Messages " );        mItem.setActionCommand( "FLOOD25" );        mItem.addActionListener( this );	    file.add( mItem );	    file.addSeparator();        mItem = new MenuItem( "Quit " );        mItem.setActionCommand( "QUIT" );        mItem.addActionListener( this );	    file.add( mItem );				this.setMenuBar( mbar );		}	public void	shutdown()		{		this.applet.stop();		this.dispose();		System.exit( 0 );		}    public void    actionPerformed( ActionEvent event )        {	    String command = event.getActionCommand();		if ( command.equals( "QUIT" ) )			{			this.shutdown();			}		else if ( command.equals( "SEND" ) )			{			this.applet.sendMessage();			}		else if ( command.equals( "TEST1" ) )			{			this.applet.runTestOne();			}		else if ( command.equals( "TEST2" ) )			{			this.applet.runTestTwo();			}		else if ( command.equals( "FLOOD25" ) )			{			this.applet.runFloodTest();			}		}	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -