All pastes #509947 Raw Edit

Seite wechseln?

public java v1 · immutable
·published 2007-05-25 18:27 UTC
rendered paste body
import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.BorderFactory;import javax.swing.JButton;import javax.swing.JComponent;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JTextArea;import javax.swing.JTextField;import javax.swing.border.BevelBorder;import com.sun.org.apache.xpath.internal.operations.String;/** * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI * Builder, which is free for non-commercial use. If Jigloo is being used * commercially (ie, by a corporation, company or business for any purpose * whatever) then you should purchase a license for each developer using Jigloo. * Please visit www.cloudgarden.com for details. Use of Jigloo implies * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR * ANY CORPORATE OR COMMERCIAL PURPOSE. */public class applet extends javax.swing.JApplet {	private JButton cmdSend;	private JTextArea areaMemberlist;	private JButton cmdLogin;	private JTextField nptNick;	private JLabel lblNick;	private JTextArea areaText;	private JTextField nptEingabe;	private boolean login;	private java.lang.String nick;	/**	 * Auto-generated main method to display this JApplet inside a new JFrame.	 */	public static void main(String[] args) {		JFrame frame = new JFrame();		applet inst = new applet();		frame.getContentPane().add(inst);		((JComponent) frame.getContentPane()).setPreferredSize(inst.getSize());		frame.pack();		frame.setVisible(true);	}	public applet() {		super();		initGUI();	}	private void initGUI() {		{			this.setSize(903, 574);			getContentPane().setLayout(null);			if (login) {				nptEingabe = new JTextField();				getContentPane().add(nptEingabe);				nptEingabe.setBounds(7, 539, 735, 28);				nptEingabe.setBorder(BorderFactory						.createEtchedBorder(BevelBorder.LOWERED));				cmdSend = new JButton();				getContentPane().add(cmdSend);				cmdSend.setText("Senden");				cmdSend.setBounds(749, 539, 147, 28);				cmdSend.addActionListener(new ActionListener() {					public void actionPerformed(ActionEvent evt) {						areaText.setText(areaText.getText() + "\r\n"								+ nptEingabe.getText());					}				});				areaText = new JTextArea();				getContentPane().add(areaText);				areaText.setBounds(7, 7, 735, 525);				areaText						.setToolTipText("Hier wird der komplette Text angezeigt");				areaText.setBorder(BorderFactory						.createEtchedBorder(BevelBorder.LOWERED));				areaText.setEditable(false);				areaMemberlist = new JTextArea();				getContentPane().add(areaMemberlist);				areaMemberlist.setBounds(749, 7, 147, 525);				areaMemberlist.setEditable(false);				areaMemberlist.setBorder(BorderFactory						.createEtchedBorder(BevelBorder.LOWERED));			} else {				lblNick = new JLabel();				getContentPane().add(lblNick);				lblNick.setText("Nickname");				lblNick.setBounds(7, 7, 126, 14);				nptNick = new JTextField();				getContentPane().add(nptNick);				nptNick.setBounds(7, 21, 133, 21);				cmdLogin = new JButton();				getContentPane().add(cmdLogin);				cmdLogin.setText("Chat betreten");				cmdLogin.setBounds(7, 42, 133, 28);				cmdLogin.addActionListener(new ActionListener() {					public void actionPerformed(ActionEvent evt) {						login = true;						nick = nptNick.getText();					}				});			}		}	}}