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.

MouseCursor ändern bei einem Hyperlink in einem JEditorPane

Empfohlene Antworten

Veröffentlicht

hallo meine lieben Java-Programmierkollegen,

ich möchte, das in meinem JEditorPane (in welchem ich eine HTML Page darstelle) der MausCursor sich beim überfahren des eingebauten Hyperlinks in ein HandCursor verwandelt...

habe schon etliches versucht und nix will klappen

danke für eure Hilfe.

Gruß Bane

hier mal der Auszug aus meinem Code:

(hilfetext ist das Objekt meines JEditorPanes)

hilfetext.addHyperlinkListener (new HyperlinkListener(){

public void hyperlinkUpdate(HyperlinkEvent e)

{

if (e.getEventType() == HyperlinkEvent.EventType.ENTERED)

{

((JEditorPane) e.getSource()).setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

}

else

if (e.getEventType() == HyperlinkEvent.EventType.EXITED)

{

((JEditorPane) e.getSource()).setCursor(

Cursor.getPredefinedCursor(

Cursor.DEFAULT_CURSOR));

}

else

// Hier wird auf einen Klick reagiert

if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)

{

hilfetext = (JEditorPane) e.getSource();

if (e instanceof HTMLFrameHyperlinkEvent)

{

HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;

HTMLDocument doc = (HTMLDocument)hilfetext.getDocument();

doc.processHTMLFrameHyperlinkEvent(evt);

}

else try

{

// Normaler Link

hilfetext.setText(loadTextResource("helpfiles","BegriffsDefinitionen.htm"));

hilfetext.setCaretPosition(0);

z2++;

listzurueck[z2] = "BegriffsDefinitionen";

hilfetext.setToolTipText("Erklärung der Fachbegriffe");

}

catch (Throwable t) {

t.printStackTrace();

}

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.