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.

Cursor-Position

Empfohlene Antworten

Hallo zusammen,

ich habe folgendes Problem.

Bin gerade dabei nen HTML-Editor zu schreiben.

Dazu habe ich eine JTextPane, hinter der ein DefaultStyledDocument und StyledEditorKit liegt.

Nun gibt es einen Toggle-Button, der lediglich das Document und Editorkit ändert und zwar in HTMLDocument und HTMLEditorKit.

Klappt soweit alles wunderbar.

Das Problem ist jedoch, dass der Cursor beim togglen, somit in der HTML-Ansicht an der gleichen Position wie in der COde-Ansicht stehen soll.

Bsp:

<html>

<head><title>bla</title></head>

<body>

>>Cursor<<huhu

</body>

</html>

Nach dem Togglen soll der Cursor somit vor huhu stehen.

Über die CaretPosition klappt das nicht, da natürlich im Code mehr Zeichen vorliegen als in der HTML-Ansicht.

Was nun?

Bis denne

André

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

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.