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.

Anzeigen von html-Datei in JEditorPane

Empfohlene Antworten

Veröffentlicht

Hallo.

Ich habe ein Problem. Ich würde gerne eine einfache HTML-Seite in einem JEditorPane anzeigen lassen. Die Struktur meines Programm sieht folgendermaßen aus: *klick*

Es handelt sich um die Datei "index.html" die ich gerne anzeigen würde. Das Anzeigen soll in der Klasse "ReleaseinfosGUI" vorgenommen werden. So sieht meine Klasse bisher aus:

package application.about;


import java.awt.GridLayout;

import java.io.IOException;


import javax.swing.JEditorPane;

import javax.swing.JPanel;


public class ReleaseinfosGUI extends JPanel {


	private static final long serialVersionUID = 1L;


	/**

	 * Standard Konstruktor

	 */

	public ReleaseinfosGUI() {

		// Grundsaetzliches

		setLayout(new GridLayout(1, 1));

		// Komponente initialisieren

		JEditorPane jep = null;

		try {

			jep = new JEditorPane("lib/index.html");

		} catch (IOException e) {

			// TODO Auto-generated catch block

			e.printStackTrace();

		}

		add(jep);

	}

}

Leider bekomme ich so immer eine Exception: java.net.MalformedURLException: no protocol: lib/index.html

Kann mir jemand helfen??? Das wäre super!!!

Greetz

Du musst eine gültige Internetadresse ala

http://www.xyz.de/

angeben, dann gehts ;)

->Hab ich in Code Tag gesetzt, weil da plötzlich nen Freenet Link hinkam

  • Autor
Du musst eine gültige Internetadresse ala
http://www.xyz.de/

angeben, dann gehts ;)

->Hab ich in Code Tag gesetzt, weil da plötzlich nen Freenet Link hinkam

Ok, danke, was brauch ich dann für ein Element wenn ich keine Seiten im Internet abrufen möchte sondern meine eigenen lokalen Files einfach nur anzeigen will?

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.