Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2663 > unrolled thread

Re: JEditorPane and HTML

Started by"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
First post2011-04-27 15:40 +0000
Last post2011-04-27 15:40 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.lang.java.gui

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: JEditorPane and HTML "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:40 +0000
    Re: JEditorPane and HTML "timtech" <timtech@THRWHITE.remove-dii-this> - 2011-04-27 15:40 +0000
      Re: JEditorPane and HTML "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:40 +0000

#2663 — Re: JEditorPane and HTML

From"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Date2011-04-27 15:40 +0000
SubjectRe: JEditorPane and HTML
Message-ID<79df57d89ceb3@uwe>
  To: comp.lang.java.gui
timtech wrote:
>Given the offset from the start of an HTML ..

HTML *offwhats?*  Can you provide an SSCCE that
demonstrates these offsets?

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#2678

From"timtech" <timtech@THRWHITE.remove-dii-this>
Date2011-04-27 15:40 +0000
Message-ID<1193148657.209517.173750@z24g2000prh.googlegroups.com>
In reply to#2663
  To: comp.lang.java.gui
On Oct 18, 12:37 pm, "Andrew Thompson" <u32984@uwe> wrote:
> timtechwrote:
> >Given the offset from the start of an HTML ..
>
> HTML *offwhats?*  Can you provide an SSCCE that
> demonstrates these offsets?
>
> --
> Andrew Thompsonhttp://www.athompson.info/andrew/
>
> Message posted viahttp://www.javakb.com

By "offsets" I mean the number of characters from the beginning of the
document (including line feeds).

Thanks

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2679

From"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Date2011-04-27 15:40 +0000
Message-ID<7a1fd6adb8045@uwe>
In reply to#2678
  To: comp.lang.java.gui
timtech wrote:
..
>By "offsets" I mean the number of characters from the beginning of the
>document (including line feeds).

In that case, you might play with this example.

Mind you, I get a start position of '0' printed, which
makes it quite odd to me that both these operations 
should effect the 'e', rather than the 's'.

<sscce>
import javax.swing.*;

class HTMLTextOffset {

  public static void main(String[] args)
    throws Exception {

    String content = "<HTML>test</HTML>";

    JEditorPane jep =
      new JEditorPane("text/html", content);
    jep.setEditable(false);

    System.out.println(
      jep.getDocument().getStartPosition() );

    jep.setCaretPosition(2);
    jep.moveCaretPosition(3);

    JOptionPane.showMessageDialog( null, jep );

    jep.setCaretPosition(0);
    jep.getDocument().remove(2,1);
    JOptionPane.showMessageDialog( null, jep );
  }
}
</sscce>

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200710/1

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web