Answers for "how do you code in Java"

0

java code

import java.awt.*;
import java.awt.event.*;

public class TextEinAusgabe2 extends Frame
{
  TextField eingabe;
  Label     ausgabe;

  public static void main( String[] args )
  {
    TextEinAusgabe2 meinFenster = new TextEinAusgabe2( "Text-Ein-/Ausgabe" );
    meinFenster.setSize( 400, 200 );
    meinFenster.setVisible( true );
  }

  public TextEinAusgabe2( String fensterTitel )
  {
    super( fensterTitel );
    Label hinweis = new Label( "Text eingeben und mit Return abschliessen" );
    eingabe = new TextField();
    ausgabe = new Label();
    add( BorderLayout.NORTH,  eingabe );
    add( BorderLayout.CENTER, hinweis );
    add( BorderLayout.SOUTH,  ausgabe );
    eingabe.addActionListener(
      new ActionListener() {
        public void actionPerformed( ActionEvent ev ) {
          meineMethode(); } } );
    addWindowListener(
      new WindowAdapter() {
        public void windowClosing( WindowEvent ev ) {
          dispose();
          System.exit( 0 ); } } );
  }

  void meineMethode()
  {
    ausgabe.setText( "Der eingelesene Text lautet: " + eingabe.getText() );
  }
}
Posted by: Guest on June-09-2021
0

HOW TO CODE JAVA???????????

int[] marks = {50, 55, 60, 70, 80}; System.out.println(marks[0]);// Output: 50 System.out.println(marks[4]);// Output: 80
Posted by: Guest on February-13-2021
1

java code

java basic code example
Posted by: Guest on January-16-2021

Code answers related to "how do you code in Java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language