How to get string from jtextpane along with its attributes

sir,
How to get string from jtextpane along with its attributes
i,e font,size,style,color etc.
please help me out.
my mail id is [email protected]

JTextPane extends JTextComponent
JTextComponent.getDocument()
a Document is a set of Element, see Document.getRootElements(). Each Element has attributes, stored within an AttributSet object see Element.getAttributes()
a Document can also be rendered as a String, see Document.getText( offest, length ), use it with 0 and Document.getLength() as parameters.

Similar Messages

  • How to get events from Jtextpane editable with graphic drawn on it ??

    HI,
    I have a Texpane with some string drawn on it at some interval according to scale.
    How do I get the event of click on it and make that particular character editable.

    Try adding a mouselistener to the pane
    appu

  • How to get the onhand quantity along with zero quantities in Inventory?

    How to get the onhand quantity along with zero quantities in Inventory...Plz reply me as son as possible?

    Hi Akshata,
    In processRequest you can use pageContext.getParameter
    String PartyName = pageContext.getParameter("PartyName");Regards,
    Sujoy

  • How to get  documentation of a report with its respective headers?

    I know fm, SRTU1_GET_REPORT_DOCUMENTATION, has to be used to get the documentation of a report. But when i print out the result it only shows the documentation data and not the data's respective headers. Without the headers the data looses its meaning.
    Any idea on how to get both the report documentation and its respective headers.
    Any help will be appreciated.
    Thanks
    Nahman

    The following code downloads program docu as pdf file:
    data: header like thead,
          options like itcpo.
    data: lines like tline occurs 0 with header line,
           otfdata like  itcoo occurs 0 with header line,
           pdflines like tline occurs 0 with header line,
           docstab like  docs occurs 0 with header line,
           binfilesize type i,
           filenm type string.
    parameters: program like trdir-name obligatory,
                filenam like rlgrap-filename default 'c:temppdftest.pdf'.
    start-of-selection.
      call function 'DOC_OBJECT_GET'
        exporting
          class                  = 'RE'
          name                   = program
         language               = sy-langu
          short_text             = 'X'
          appendix               = 'X'
       importing
         header                 = header
        tables
    *   RTF_LINES              =
          itf_lines              = lines
       exceptions
         object_not_found       = 1
         others                 = 2
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      options-tdgetotf = 'X'.
      options-tdprogram = 'SAPLSHL2'.
      options-TDDEST = 'LOCL'.
      call function 'PRINT_TEXT'
        exporting
          application                    = 'TD'
    *   ARCHIVE_INDEX                  = ' '
    *   ARCHIVE_PARAMS                 = ' '
          device                         = 'PRINTER'
          dialog                         = ' '
          header                         = header
          options                        = options
    * IMPORTING
    *   NEW_ARCHIVE_PARAMS             =
    *   RESULT                         =
        tables
          lines                          = lines
          otfdata                        = otfdata
       exceptions
         canceled                       = 1
         device                         = 2
         form                           = 3
         options                        = 4
         unclosed                       = 5
         unknown                        = 6
         format                         = 7
         textformat                     = 8
         communication                  = 9
         bad_pageformat_for_print       = 10
         others                         = 11
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      refresh lines.
      call function 'CONVERT_OTF_2_PDF'
    * EXPORTING
    *   USE_OTF_MC_CMD               = 'X'
    *   ARCHIVE_INDEX                =
       importing
         bin_filesize                 = binfilesize
        tables
          otf                          = otfdata
          doctab_archive               = docstab
          lines                        = pdflines
       exceptions
         err_conv_not_possible        = 1
         err_otf_mc_noendmarker       = 2
         others                       = 3
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      filenm = filenam.
      call function 'GUI_DOWNLOAD'
        exporting
    *   BIN_FILESIZE                    =
          filename                        = filenm
          filetype                        = 'BIN'
        tables
          data_tab                        = pdflines
    *   FIELDNAMES                      =
       exceptions
         file_write_error                = 1
         no_batch                        = 2
         gui_refuse_filetransfer         = 3
         invalid_type                    = 4
         no_authority                    = 5
         unknown_error                   = 6
         header_not_allowed              = 7
         separator_not_allowed           = 8
         filesize_not_allowed            = 9
         header_too_long                 = 10
         dp_error_create                 = 11
         dp_error_send                   = 12
         dp_error_write                  = 13
         unknown_dp_error                = 14
         access_denied                   = 15
         dp_out_of_memory                = 16
         disk_full                       = 17
         dp_timeout                      = 18
         file_not_found                  = 19
         dataprovider_exception          = 20
         control_flush_error             = 21
         others                          = 22
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    Regards
    Sridhar

  • How to get all parameter names along with their values in stored procedure which is being executed

    Im using sql server 2012, is there any possible way to get all the parameters of a stored procedure along with the values passed to it.
    I need these things to build a xml. I mean this should happen in the procedure which being executed and it should be common for all the procedures.
    For example, let us suppose we have to procedures,
    uspSave, @name='test' @age=20
    uspDelete @id=2
    now in uspSave procedure, i need to get @name, @age and the values 'test', 20 and in uspDelete, i should get @id with value 2.
    For getting the column names, i tried this,
    select parameter_name from information_schema.PARAMETERS where specific_name=OBJECT_NAME(@@procid)
    now is it possible to loop through the result of above query and can we get the values.

    I think  you need running SQL Server Profiler to capture this info even in SQL Server 2012.
    Best Regards,Uri Dimant SQL Server MVP,http://sqlblog.com/blogs/uri_dimant/
    Blog : MS SQL Development and Optimization
    Blog : Large
    scale of database and cleansing

  • How to get Class Name given along with java.exe

    Hi friends,
    I am Mukesh, currently facing one problem
    On command prompt to execute any java program we give :
    C : \.-- > java ClassName
    This ClassName I need in my application, I want to do some post processing on that.
    Actually see what I want :
    public class Base
    static Base object;
    public static void main(String[] args) throws Exception
    object=(Base)Class.forName("Derived Class Name").newInstance();
    void main()
    public class Derived extends Base
    void main()
    System.out.println("Hello World");
    I am trying to Run Derived Class, since there is no entry point found, default JVM invoke the Base class's entry point, there I want to load
    Derived Class, but I am not getting any identity of derived class in Base class.
    I found one temporary solution to this problem :
    C: \ -- >java Derived Derived
    & in Base class, I have loaded class
    object=Class.forName(args[0]).newInstance();
    But I dont want to write the same thing twise just to know the Class name which is given along with java.exe.
    Is there any way to get the ClassName supplied with java.exe
    I have tried a lot, still I am trying !!!
    If any one knows the answer, help me.
    Regards.
    Mukesh.

    Multiple post. Please continue in other thread
    http://forum.java.sun.com/thread.jspa?threadID=5196980&tstart=0

  • How to get InputStream from a file with absolute path?

    Hi, guys:
    If I have file with a absolute path that may be inside/outside
    my Eclipse plugin, I want to get an InputStream from it. It just keeps giving me null for "is":
    String absFilePath = "/D:/my_dir/.../sample_file.txt";
    InputStream is = getClass().getResourceAsStream(absFilePath);
    regards,

    Don't use resource as stream if you have an absolute path, use FileInputStream.

  • How to get string from a stringBuider reference

    Please see attached image.
    How do I take the values from stringbuilder reference,into LabVIEW string?
    (The DLL is C# and is proven)
    Pls. help.
    Attachments:
    HowToMap_LV_String2StringBuilderReference.zip ‏43 KB

    Just connect the response element to an Invoke Node and select the ToString() method for the StringBuilder class.

  • How to get unique Id's along with using a formula in Report

    Hi,
    I have data in the following format:
    PO no  Subfield Created date Changed date
    123              A               01/01/2011        20/01/2011
    123              B               01/01/2011        20/01/2011
    124              A               01/01/2011        25/01/2011
    124              B              01/01/2011        25/01/2011
    I want to get  unique number of PO's which has difference(changed date - created date)  greater thn 20days and less thn 20days.
    So I want to get in report:
    PO no >20    <20
    123             ____        1
    124            1       _____
    I know to get unique PO number and how to calculate two dates difference in days by using formula variable replacement path.
    But how to incorporate these two functions.
    Edited by: SAP Consultant on Aug 14, 2011 8:34 AM
    Edited by: SAP Consultant on Aug 14, 2011 8:35 AM

    Hi,
    This link will help you:----
    Calculate difference of days between two dates
    Regards,
    Suman

  • Getting the parenet id along with the child ids in hierarchy query results

    create table test_test2 (do_id_tp varchar2(32),do_id number ,do_up_tp varchar2(32),do_up_id number)
    insert into test_test2 values('A_S',100170,'A_S',100001);
    insert into test_test2 values('A_S',1001054,'A_S',100001);
    insert into test_test2 values('A_S',1001055,'A_S',100001);
    insert into test_test2 values('A_S',1001053,'A_S',100001);
    insert into test_test2 values('A_S',1001056,'A_S',100001);
    insert into test_test2 values('A_S',1001051,'A_S',100001);
    insert into test_test2 values('A_S',1001052,'A_S',100001);
    insert into test_test2 values('A_S',100358,'A_S',100170);
    insert into test_test2 values('A_S',100359,'A_S',100170);
    insert into test_test2 values('A_S',100441,'A_S',100170);
    insert into test_test2 values('A_S',1001047,'A_S',100441);
    9/code]
    Upon executing the following query , i'm getting the childs of 100001 and the childs of childs of 100001 etc..
    That if fine .But in the output i'm not getting the parent id i.e; 100001 (which is in the where condition)
    How to get the parenet id along with the childs id.( without writing the UNION select 100001 from dual)SELECT do_id
    FROM (
    SELECT d.do_id, d.do_up_id
    FROM test_test2 d
    WHERE d.do_up_tp = 'A_S' ) m
    CONNECT BY NOCYCLE PRIOR m.do_id = m.do_up_id
    START WITH m.do_up_id =100001
    Edited by: smile on Jan 12, 2012 6:50 PM

    If you wish the root parent as a column in your select, you can use CONNECT_BY_ROOT:
    SELECT
    connect_by_root(do_up_id) root,
    do_up_id parent,
    do_id
    FROM (
       SELECT  d.do_id, d.do_up_id
       FROM test_test2 d
       WHERE    d.do_up_tp = 'A_S'
    ) m
    CONNECT BY NOCYCLE PRIOR m.do_id = m.do_up_id
    START WITH m.do_up_id =100001;But if you really wish an extra row in your output with 100001, then your problem is that you do not have a record in your data with do_id = 100001.
    Then you either need such a record in your data, or you need to create such a row with for example union all - something like this:
    SELECT
    do_id
    FROM (
       SELECT  d.do_id, d.do_up_id
       FROM test_test2 d
       WHERE    d.do_up_tp = 'A_S'
       UNION ALL
       SELECT 100001 do_id, NULL do_up_id
       FROM DUAL
    ) m
    CONNECT BY NOCYCLE PRIOR m.do_id = m.do_up_id
    START WITH m.do_up_id IS NULL;

  • How to get string (specified by line and column) from txt file with labview

    Hi everyone
    How to get string (specified by line and column) from txt file with labview
    thx 
    Solved!
    Go to Solution.

    As far as I know, a text file has no columns.  Please be more specific.  Do you mean something like the 5th word on line 4, where words are separated by a space, and lines are separated by a newline character?  You could the Read from Spreadsheet String function and set the delimiter to a space.  This will produce a 2D array of strings.  Then use index array and give the line number and column number.
    - tbob
    Inventor of the WORM Global

  • How can I get String from Bytes

    I want to get String from array of bytes but i have some trouble from byte that it's lager more than 128. How can I do ???
    Please hepl me. Thanks very much.

    This program is only to show you what the relationships are between unsigned byte, signed byte, character, and binary values. Because of the constraints that Java has, the program code is not especially clean. Run the program and see if it helps. As has been said, the character output is dependent on the encoding in use.
    Here is a sample of some of its output:
    Unsigned byte= 189 Signed byte= -67 Character= � Binary= 10111101
    Unsigned byte= 190 Signed byte= -66 Character= � Binary= 10111110
    Unsigned byte= 191 Signed byte= -65 Character= � Binary= 10111111
    Unsigned byte= 192 Signed byte= -64 Character= � Binary= 11000000
    Unsigned byte= 244 Signed byte= -12 Character= � Binary= 11110100
    Unsigned byte= 245 Signed byte= -11 Character= � Binary= 11110101
    Unsigned byte= 246 Signed byte= -10 Character= � Binary= 11110110
    public class ATest {
        public static void main(String[] args) {
            int in;
            byte by;
            String bin;
            char chr;
            for(in=0; in<256; in++) {
                // create a byte whose binary value is equal to the;
                // integer loop counter;
                by = (byte)in;
                // mask off sign extension [that I don't agree with!] and;
                // cast the resultant 8 bits to a char;
                chr = (char)(by & 0x00ff);
                // since there's no Byte.toInteger, must cast to int to get;
                // binary string and then delete unwanted portion of string;
                if(in<128) {
                    bin = Integer.toBinaryString((int)by);
                } else {
                    bin = Integer.toBinaryString((int)by).substring(24);
                // print everything;
                System.out.println(
                    "Unsigned byte= "+in+
                    " Signed byte= "+by+
                    " Character= "+chr+
                    " Binary= "+bin);
    }

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • How to get photos from iphoto back onto an SD card. I have a MacBook Pro with a built in SC card slot.

    How to get photos from iPhoto back onto a SD card. I have a MacBook Pro with built in SD card slot. I have tried "Export" but this does not work.

    It's best to export the photos to a folder and then drag the folder onto the memory card.  Memory cards are usually formatted for PCs, FAT 32, which doesn't permit more than a limited number of files in the root directory. Putting the photos in a folder gets around that limitation.
    OT

  • How to get info from a layer which is  applied  with styles  ?

    How to get info from a  layer  ?  such  as   (  apply  style  or  not , which  effect  have  applied  on  it  etc..)
    I  really  can't  solve  it , Who can hlep me..  By the way , I 'am  using  CS version.  

    xtools/xlib/Styles.js has a set of functions for working with layer styles. I do not know if it works with CS. I wrote it several years ago for either CS or CS2. If this doesn't work, then nothing will. The script retrieves a layer's style by saving it to disk then parsing the file for the desired ActionDescriptor.
    There is a function at the bottom of the file that tests the Styles.js API.
    Styles.test = function() {  var doc = app.activeDocument;
      var layer0 = doc.artLayers[0];
      var gdesc = Styles.getLayerStyleDescriptor(doc, layer0);
      if (!gdesc) {
        alert("There is no layer style associated with the layer");
        return;
    //   this will set the layer style to another layer.
    //   var layer1 = doc.artLayers[1];
    //   Styles.setLayerStyleDescriptor(doc, layer1, gdesc);
      if (!gdesc.hasKey(cTID('FrFX'))) {  // look for a stroke effect
        return;
      var frfx = gdesc.getObjectValue(cTID('FrFX'));
      if (!frfx.hasKey(cTID('Clr '))) {   // look for the color
        return;
      var clr = frfx.getObjectValue(cTID('Clr '));
      // we should really check that the objectType is RGBC
      var r = clr.getDouble(cTID('Rd  '));
      var g = clr.getDouble(cTID('Grn '));
      var b = clr.getDouble(cTID('Bl  '));
      if (r == 0 && g == 0xFF && b == 0xFF) {
        return;
      clr.putDouble(cTID('Rd  '), 0);
      clr.putDouble(cTID('Grn '), 0xFF);
      clr.putDouble(cTID('Bl  '), 0xFF);
      frfx.putObject(cTID('Clr '), cTID('RGBC'), clr);
      gdesc.putObject(cTID('FrFX'), cTID('FrFX'), frfx);
      Styles.setLayerStyleDescriptor(doc, layer0, gdesc);

Maybe you are looking for

  • Sort Order Driven By Other Field In PowerView on a Relational Source

    Hi, Is there a way to sort an attribute in a chart by a different attribute that is not shown in the chart on a relational source (as e.g. possible with a PowerPivot table source where you can specify to use a different field as sort order)? I achiev

  • SCOM 2012 SP1 Report Timed out

    Hi All, My large reports are timing out after 30 minutes in SCOM 2012 SP1, with the error: The Operation has timed out I'm trying to run the Performance Detail report from Microsoft Generic Report Library against Windows Server 2008 Operating System

  • Data struct in rsa7

    Hi guys, I came across an issue while loading data from the r/3 system to BI.The Infopackage which carries the data to the bi is fetching 0 recs...while the RSA7 queue is having data for the current selection. Can any one of tell me what could be the

  • Where the heck can I find a link to this thread I am posting right now?

    I have clicked about every link on my profile page on this site, and can't find anything about the question I have posted. The only way I can find my way back at all is to save the link in the first place or wait for someone to reply and click the li

  • Load URL within a Jeditorpane

    How is it possible to load an html file in order to be presented in a jeditorpane from a URL? Thanks on advance