Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ActionListener

Empfohlene Antworten

Veröffentlicht

Guten Morgen,

kann mir bitte einer von euch sagen, warum ich den ActionListener in eine externe Klasse tun kann. Der ActionListener ist makiert /*************************


import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import java.util.*;


class PropertyGui extends JFrame implements ActionListener

{

    static JTextField werttfd;

    static JTextField  beschreibungtfd;

    static JComboBox auswahlcmb;

    static Vector vrowData = new Vector();

    Vector vcolumnNames = new Vector();


    public void actionPerformed(ActionEvent e)

    {        

        JPanel all = getContent();	

		getContentPane().add(all);


		setLocation(150,80);

		setSize(435,500);

		setTitle("Property - Verwaltung");

		setVisible(true);


		addWindowListener(new WindowClose());

    }


    private JPanel getContent()

	{		

		JPanel haupt = new JPanel();

		haupt.setLayout(null);


		JLabel auswahllb = new JLabel("Property - Auswahl");

		auswahllb.setBounds(20, 15, 160, 25);

		JLabel anzeigelb = new JLabel("Property - Anzeige");

		anzeigelb.setBounds(20, 85, 160, 25);

		JLabel wertlb = new JLabel("Wert");

		wertlb.setBounds(20, 295, 160, 25);

		JLabel beschreibunglb = new JLabel("Beschreibung");

		beschreibunglb.setBounds(20, 365, 160, 25);


		Vector inhalt = new Vector();

		inhalt.add("Modus");

		inhalt.add("Handbuch");

		inhalt.add("Ergebnistyp");


		auswahlcmb = new JComboBox(inhalt);

		auswahlcmb.setBounds(20, 45, 220, 25);

		auswahlcmb.addActionListener(new PropertyAuswahl());


		JButton hinzufuegen = new JButton("Hinzufügen");

		hinzufuegen.addActionListener(new Hinzufuegen());

		hinzufuegen.setBounds(80, 255, 120, 25);

		JButton entfernen = new JButton("Entfernen");

		entfernen.addActionListener(new Entfernen());

		entfernen.setBounds(215, 255, 120, 25);

		JButton speichern = new JButton("Speichern");

		speichern.addActionListener(new Speichern());

		speichern.setBounds(80, 435, 120, 25);

		JButton abbrechen = new JButton("Abbrechen");

/***************************************************

		abbrechen.addActionListener(new ActionListener()

	    {

	        public void actionPerformed(ActionEvent e)

	        {

	            setVisible(false);

	        }

		});

		abbrechen.setBounds(215, 435, 120, 25);


		werttfd = new JTextField();

		werttfd.setBounds(20, 320, 390, 25);

		beschreibungtfd = new JTextField();

		beschreibungtfd.setBounds(20, 395, 390, 25);


		vcolumnNames.add("Wert");

		vcolumnNames.add("Beschreibung");


		Vector vrowData1 = new Vector();

		vrowData.add(vrowData1);

		vrowData1.add("Test1");

		vrowData1.add("Test");



		JTable table = new JTable(vrowData,vcolumnNames);

		JScrollPane scroll = new JScrollPane(table);

		scroll.setBounds(20, 115, 390, 125);


		haupt.add(auswahllb);

		haupt.add(auswahlcmb);

		haupt.add(anzeigelb);

		haupt.add(scroll);

		haupt.add(hinzufuegen);

		haupt.add(entfernen);

		haupt.add(wertlb);

		haupt.add(werttfd);

		haupt.add(beschreibunglb);

		haupt.add(beschreibungtfd);

		haupt.add(speichern);

		haupt.add(abbrechen);


		return haupt;

	}

}

Danke, hat sich erledigt

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.