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.

Problem mit BorderLayout

Empfohlene Antworten

Veröffentlicht

Also erstmal bitte nicht schlagen, nur sehr eingeschränktes Java KnowHow :rolleyes:

Ich möchte gern folgendes mittels eines BorderLayout(s) ausrichten:


JPanel panel = new JPanel();

panel.setLayout(new BorderLayout());

panel.add(BorderLayout.NORTH,menuBar);


panel.add(addrLabel); //Pfad:

panel.add(addrText); //JTextField

panel.add(goButton); //LOS

Es sollen nachher wie folgt aussehen:

oben links-> "JMenuBar"

darunter -> "addrLabel" daneben "addrText" daneben "goButton"

die untere Zeile soll quasi meine Adress-Leiste sein

(wie Internetexplorer ausgerichtet also Adresse, Adressfeld,Abschicken-Button)

Sry, kann es nicht so gut erklären...ist etwas umständlich :(

Bisher klappt es, dass die JMenuBar oben links ist!

Habe schon ein paar Tutorials gelesen, aber nicht gefunden, wie ich die Sachen untereinander und nebeneinander anordnen kann!?

Würde mich freuen, wenn mir Jemand grade die 5 Zeilen schreibt bzw. mir hilft!

Vielen Dank!

LG Honeybee

Du kannst Panels ineinander verschachteln.

DefaultLayout ist das FlowLayout.


JPanel panel = new JPanel();

panel.setLayout(new BorderLayout());

panel.add(BorderLayout.NORTH,menuBar);


JPanel adressPanel = new JPanel();

adressPanel.add(addrLabel); //Pfad:

adressPanel.add(addrText); //JTextField

adressPanel.add(goButton); //LOS


panel.add(BorderLayout.CENTER, adressPanel);

ungetestet.

Gruß Jaraz

Danke!

Funktionier und genau das, was ich haben wollte!!! :e@sy :)

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.