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.

Java Ausgaben in ein anderes Fenster

Empfohlene Antworten

Veröffentlicht

Hi,

wie der Tietel schon sagt möchte ich meine Ausgabe die Normal in die Konsole gehen würde, in eine Auswählbares Fenster ausgeben.

Also so wie ein Text Bot auch abeiten würde.

denke mal Code ist dafür nicht relevant, da ich bis jetzt nur ausgaben via System.out.println mache.

Hat jemand das schonmal gemacht und kann mir helfen?

Lg

Ich hab das vor einiger Zeit mal gemacht. Hab einfach einen eigenen Printstream als Out- und Error- Kanal gesetzt und alles was da drüber wollte eben dann in eine JTextArea geschrieben.

		OutputStream out = new OutputStream() {

			public void write(int arg0) throws IOException {

				addStatus((char)arg0);

			}

		};


		System.setErr(new PrintStream(out));

		System.setOut(new PrintStream(out));
	public void addStatus(char c){

		try {

			this.status.setText(this.status.getText()+c);


			this.scroller.getVerticalScrollBar().setValue(

						this.scroller.getVerticalScrollBar().getMaximum());

		} catch (Exception e) {}

	}

EDIT:

this.status ist eine JTextArea

this.scroller ist das JScrollPane auf welchem die JTextArea liegt.

Bearbeitet von speedi

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.