java.lang.Object
javax.mail.Address
javax.mail.internet.NewsAddress
- All Implemented Interfaces:
- Serializable
- See Also:
- Top Examples, Source Code
public boolean equals(Object a) - See Also:
- Address
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String getHost() - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String getNewsgroup() - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[757]Serializable JFrame By ISMAIANA { at } MSN { dot } COM on 2004/04/30 16:03:57 Rate
public class Test extends JFrame implements Serializable { Test nntp1=new Test ( ) ; String serverName = new String ( " " ) ; static int counter = 0; int objNum; String objName; Vector others; Vector listItems = new Vector ( ) ; Server server; JButton button = new JButton ( "Get Newsgroups" ) ; JButton cancel = new JButton ( "Cancel" ) ; JLabel label = new JLabel ( ) ; JTextField txtField = new JTextField ( " " ) ; JList list; private Vector artikels = new Vector ( ) ; // tabel voor het presenteren van artikllen String [ ] headers = { "Article #", "Subject", "From", "Date" } ; DefaultTableModel data = new DefaultTableModel ( headers, 0 ) ; JTable subjectsTable = new JTable ( data ) ; String [ ] messageIDs = new String [ 200 ] ; int articleIndex = 0; private String nntpServer = ""; private String group = ""; private int port = 119; private String NntpMessage; private JLabel status = new JLabel ( "Ready..." ) ; private JTextArea Jbody = new JTextArea ( 10,20 ) ; private Vector messages = new Vector ( ) ; private JList msgList = new JList ( ) ; private File root = new File ( "" ) ; private JPanel contentPane; private JMenuBar jMenuBar1 = new JMenuBar ( ) ; private JMenu jMenuFile = new JMenu ( ) ; private JMenuItem jMenuFileExit = new JMenuItem ( ) ; private BorderLayout borderLayout1 = new BorderLayout ( ) ; private TitledBorder titledBorder1; private JPanel jPanel2 = new JPanel ( ) ; private TitledBorder titledBorder2; private XYLayout xYLayout1 = new XYLayout ( ) ; private JPanel jPanel3 = new JPanel ( ) ; private JButton jButton4 = new JButton ( ) ; private JButton GetNewsgroups = new JButton ( ) ; // JTextArea messageTextArea = new JTextArea ( ) ; // private TitledBorder titledBorder3; private JMenu jMenuHelp = new JMenu ( ) ; private JMenuItem jMenuHelpAbout = new JMenuItem ( ) ; ImageIcon plaatje = null; private JPanel jPanel4 = new JPanel ( ) ; private JPanel jPanel8 = new JPanel ( ) ; private JLabel jLabel1 = new JLabel ( ) ; private BorderLayout borderLayout11 = new BorderLayout ( ) ; private VerticalFlowLayout verticalFlowLayout2 = new VerticalFlowLayout ( ) ; private JPanel jPanel9 = new JPanel ( ) ; private JButton Naamwijzigen = new JButton ( ) ; private JLabel jLabel2 = new JLabel ( ) ; private JMenu jMenu1 = new JMenu ( ) ; private JMenuItem jMenuItem1 = new JMenuItem ( ) ; private JMenuItem jMenuItem2 = new JMenuItem ( ) ; private JMenuItem jMenuItem3 = new JMenuItem ( ) ; private JMenuItem jMenuItem4 = new JMenuItem ( ) ; private JButton verscherpFilter = new JButton ( ) ; private XYLayout xYLayout2 = new XYLayout ( ) ; private JTextArea jTextArea1 = new JTextArea ( ) ; private JPanel jPanel1 = new JPanel ( ) ; private XYLayout xYLayout3 = new XYLayout ( ) ; private JScrollPane jScrollPane1 = new JScrollPane ( ) ; private JTable subjectsTable1 = new JTable ( data ) ; private JTable jTable1 = new JTable ( ) ; private jButton buton=new Buton ( ) ; //Construct the frame public Test ( ) { objNum = ++ counter; objName = "MyClass instance number " + objNum; { } // the usual "toString" is easy: public String toString ( ) { return objName; } } } GetNewsgroups.addActionListener ( new java.awt.event.ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { GetNewsgroups_actionPerformed ( e ) ; } } ) ; jLabel2.setHorizontalAlignment ( SwingConstants.CENTER ) ; jLabel2.setHorizontalTextPosition ( SwingConstants.CENTER ) ; jLabel2.setText ( "Naam" ) ; jMenu1.setFont ( new java.awt.Font ( "Dialog", 3, 14 ) ) ; jMenu1.setText ( "Accounts" ) ; jMenuItem1.setFont ( new java.awt.Font ( "Dialog", 2, 14 ) ) ; jMenuItem1.setText ( "Toevoegen" ) ; jMenuItem1.addActionListener ( new java.awt.event.ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { } } ) ; jButton4.addActionListener ( new java.awt.event.ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { jButton4_actionPerformed ( e ) ; } } ) ; contentPane = ( JPanel ) this.getContentPane ( ) ; titledBorder1 = new TitledBorder ( "" ) ; titledBorder2 = new TitledBorder ( "" ) ; titledBorder3 = new TitledBorder ( "" ) ; contentPane.setLayout ( borderLayout1 ) ; this.setFont ( new java.awt.Font ( "Dialog", 3, 14 ) ) ; this.setSize ( new Dimension ( 716, 455 ) ) ; this.setTitle ( "Nieuws Client" ) ; jMenuFile.setFont ( new java.awt.Font ( "Dialog", 3, 14 ) ) ; jMenuFile.setText ( "Bestand" ) ; jMenuFileExit.setFont ( new java.awt.Font ( "Dialog", 2, 14 ) ) ; jMenuFileExit.setText ( "Exit" ) ; jMenuFileExit.addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { jMenuFileExit_actionPerformed ( e ) ; } } ) ; jMenuBar1.setFont ( new java.awt.Font ( "Dialog", 3, 14 ) ) ; jMenuBar1.setBorder ( null ) ; contentPane.setFont ( new java.awt.Font ( "Dialog", 3, 14 ) ) ; contentPane.setBorder ( BorderFactory.createLoweredBevelBorder ( ) ) ; contentPane.setMinimumSize ( new Dimension ( 640, 480 ) ) ; contentPane.setPreferredSize ( new Dimension ( 640, 480 ) ) ; jPanel2.setLayout ( xYLayout2 ) ; jPanel3.setBorder ( BorderFactory.createRaisedBevelBorder ( ) ) ; jPanel3.setMinimumSize ( new Dimension ( 10, 46 ) ) ; jPanel3.setPreferredSize ( new Dimension ( 10, 46 ) ) ; jPanel3.setLayout ( xYLayout1 ) ; jButton4.setBorder ( null ) ; jButton4.setMaximumSize ( new Dimension ( 67, 41 ) ) ; jButton4.setMinimumSize ( new Dimension ( 67, 41 ) ) ; jButton4.setPreferredSize ( new Dimension ( 67, 41 ) ) ; jButton4.setToolTipText ( "Server " ) ; jButton4.setFocusPainted ( false ) ; jButton4.setIcon ( new ImageIcon ( new java.net.URL ( "file:///" +rootDir +"icons/inloggen.JPG" ) ) ) ; jButton4.setText ( "Setup Server" ) ; GetNewsgroups.setBorder ( null ) ; GetNewsgroups.setToolTipText ( " openen" ) ; GetNewsgroups.setFocusPainted ( false ) ; GetNewsgroups.setIcon ( new ImageIcon ( new java.net.URL ( "file:///" +rootDir +"icons/open.JPG" ) ) ) ; GetNewsgroups.setText ( "Get Newsgroups" ) ; jMenuHelp.setFont ( new java.awt.Font ( "Dialog", 3, 14 ) ) ; jMenuHelp.setText ( "Help" ) ; jMenuHelpAbout.setFont ( new java.awt.Font ( "Dialog", 2, 14 ) ) ; jMenuHelpAbout.setText ( "Info" ) ; jMenuHelpAbout.addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { jMenuHelpAbout_actionPerformed ( e ) ; } } ) ; jTextArea1.setText ( "jTextArea1" ) ; jPanel1.setLayout ( xYLayout3 ) ; jScrollPane1.setPreferredSize ( new Dimension ( 260, 100 ) ) ; jScrollPane1.setMinimumSize ( new Dimension ( 260, 100 ) ) ; jScrollPane1.setMaximumSize ( new Dimension ( 260, 100 ) ) ; subjectsTable1.setCellSelectionEnabled ( false ) ; subjectsTable1.setRowSelectionAllowed ( true ) ; subjectsTable1.addMouseListener ( new java.awt.event.MouseAdapter ( ) { public void mouseClicked ( MouseEvent e ) { subjectsTable1_mouseClicked ( e ) ; } } ) ; subjectsTable1.setShowHorizontalLines ( false ) ; subjectsTable1.setShowVerticalLines ( false ) ; cancel.setFont ( new java.awt.Font ( "Dialog", 1, 12 ) ) ; cancel.setText ( "Cancel" ) ; jMenuFile.add ( jMenuItem4 ) ; jMenuFile.addSeparator ( ) ; jMenuFile.add ( jMenuFileExit ) ; jMenuBar1.add ( jMenuFile ) ; jMenuBar1.add ( jMenu1 ) ; jMenuBar1.add ( jMenuHelp ) ; this.setJMenuBar ( jMenuBar1 ) ; contentPane.add ( jPanel2, BorderLayout.CENTER ) ; jPanel2.add ( jPanel1, new XYConstraints ( 16, 17, 687, 27 ) ) ; jPanel1.add ( jScrollPane1, new XYConstraints ( 0, 0, 672, -1 ) ) ; jPanel2.add ( jTextArea1, new XYConstraints ( 16, 172, 675, 186 ) ) ; jPanel2.add ( jTable1, new XYConstraints ( 16, 41, 669, 131 ) ) ; jScrollPane1.add ( subjectsTable1, null ) ; jPanel3.add ( jButton4, new XYConstraints ( 6, 2, 163, 36 ) ) ; jPanel3.add ( GetNewsgroups, new XYConstraints ( 211, 2, 195, 36 ) ) ; jPanel3.add ( cancel, new XYConstraints ( 476, 8, 122, -1 ) ) ; jMenuHelp.add ( jMenuHelpAbout ) ; jPanel8.add ( jLabel1, BorderLayout.CENTER ) ; contentPane.add ( jPanel3, BorderLayout.NORTH ) ; jPanel9.add ( jLabel2, null ) ; jPanel9.add ( Naamwijzigen, null ) ; jMenu1.add ( jMenuItem1 ) ; jMenu1.add ( jMenuItem2 ) ; jMenu1.addSeparator ( ) ; jMenu1.add ( jMenuItem3 ) ; Dimension frmSize = this.getSize ( ) ; Point loc = getLocation ( ) ; jScrollPane1.getViewport ( ) ; } void jButton11_actionPerformed ( ActionEvent e ) { } { } void GetNewsgroups_actionPerformed ( ActionEvent e ) { if ( evt.getSource ( ) == button ) { serverName = txtField.getText ( ) ; label.setText ( "Verbinding met : " + serverName ) ; repaint ( ) ; server = new Server ( serverName, 119 ) ; server.GetGroups ( ) ; } else if ( evt.getSource ( ) == cancel ) { server.thread.stopped=true; list.setListData ( server.groups ) ; repaint ( ) ; } } void jButton4_actionPerformed ( ActionEvent e ) { SetupDialoog dlg = new SetupDialoog ( this,"SETUP",true ) ; Dimension dlgSize = dlg.getPreferredSize ( ) ; Dimension frmSize = getSize ( ) ; Point loc = getLocation ( ) ; dlg.setLocation ( ( frmSize.width - dlgSize.width ) / 2 + loc.x, ( frmSize.height - dlgSize.height ) / 2 + loc.y ) ; dlg.setModal ( true ) ; dlg.pack ( ) ; dlg.show ( ) ; } // "main" to run the demo... public static void main ( String [ ] args ) throws Exception { if ( args.length > 0 && args [ 0 ] .charAt ( 0 ) == 'w' ) { // write requested // create a few objects and connect them: MyClass first = new MyClass ( ) ; first.others = new Vector ( ) ; first.others.addElement ( first ) ; // add ourselves to list! for ( int i = 1; i < 4; ++i ) first.others.addElement ( new MyClass ( ) ) ; // create the output stream FileOutputStream fos = new FileOutputStream ( "demo.ser" ) ; ObjectOutputStream oos = new ObjectOutputStream ( fos ) ; // all that is needed to write ALL the created objects! oos.writeObject ( first ) ; oos.close ( ) ; } // no matter what, we try to read the stream FileInputStream fis = new FileInputStream ( "demo.ser" ) ; ObjectInputStream ois = new ObjectInputStream ( fis ) ; MyClass mc = ( MyClass ) ois.readObject ( ) ; ois.close ( ) ; for ( int ix = 0; ix < mc.others.size ( ) ; ++ix ) System.out.println ( mc.others.elementAt ( ix ) .toString ( ) ) ; } // end of main Test inter = new Test ( ) ; inter.setSize ( 200,300 ) ; inter.show ( ) ; } void subjectsTable1_mousePressed ( MouseEvent e ) { } void subjectsTable1_mouseReleased ( MouseEvent e ) { } void subjectsTable1_mouseEntered ( MouseEvent e ) { } void subjectsTable1_mouseExited ( MouseEvent e ) { } void subjectsTable1_mouseClicked ( MouseEvent e ) { } }
public String getType() - See Also:
InternetAddress , Address
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int hashCode() - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected String host - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public NewsAddress() - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public NewsAddress(String newsgroup) - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public NewsAddress(String newsgroup,
String host) - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected String newsgroup - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static NewsAddress[] parse(String newsgroups)
throws AddressException - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setHost(String host) - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setNewsgroup(String newsgroup) - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String toString() - See Also:
- Address
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static String toString(Address[] addresses) - Geek's Notes:
- Description Add your codes or notes Search More Java Examples
| Popular Tags |