Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

32 AWT-Dialogelemente > 32.7 TextArea - Pg. 723

TextArea Kapitel 32 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 /* TextField3.inc */ private void customizeLayout(Panel panel) { panel.setLayout(new FlowLayout(FlowLayout.LEFT)); Panel labelPanel = new Panel(); labelPanel.setLayout(new GridLayout(3,1)); labelPanel.add(new Label("Name",Label.LEFT)); labelPanel.add(new Label("Vorname",Label.LEFT)); labelPanel.add(new Label("Ort",Label.LEFT)); Panel editPanel = new Panel(); editPanel.setLayout(new GridLayout(3,1)); //Dieses Textfeld sendet Action- und Text-Ereignisse TextField tf = new TextField("Meier",20); tf.addActionListener(this); tf.addTextListener(this); editPanel.add(tf); //Diese Textfelder senden keine Ereignisse editPanel.add(new TextField("Luise",20)); editPanel.add(new TextField("Hamburg",20)); panel.add(labelPanel); Listing 32.8: Textfelder mit Beschriftung