Create a Text Editor with Java

I'd really like to create a text editor using Java but, i'm having a little trouble figuring out which direction to take to create it. I'm thinking of purchacing a book on Swing, I know there must be more to learn though. are there anything else that might be useful in achieving my goal?
Thanks,
JV
Message was edited by:
Shockwave83

look at the demo examples provided with your jdk.
For example : jdk1.5.0_10\demo\jfc\Notepad

Similar Messages

  • How to create a text editor, the one like header text in PO

    Dear Ones,
    My requirement is that I want to create a text editor for storing terms and condition plant wise.
    The editor should be the one like header text in PO. It can take end number of lines.
    I created the text object ('TERMS') in table ttxob and text for it in table ttxot.
    Also created text id ('L000' and 'L001') in table ttxid and text for it in table ttxit.
    Now using FM read_text, save_text and edit_text, I have written a program but it does not save the data.
    When I run the program initially it displays me blank, then I enter some data into it. Again when I come back it displays the data and also saves the edition. But if I close my session the data is gone.
    It means it is not actually saving the data in database. My code is as below:
    *& Report ZAK_TEXT_EDITOR
    REPORT zak_text_editor.
    DATA : head TYPE STANDARD TABLE OF thead WITH HEADER LINE,
           line TYPE STANDARD TABLE OF tline WITH HEADER LINE.
    DATA : tdname TYPE thead-tdname.
    SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text-001.
    SELECTION-SCREEN : SKIP 1.
    PARAMETERS       : id TYPE thead-tdid OBLIGATORY
                               MATCHCODE OBJECT zak_textid.
    SELECTION-SCREEN : SKIP 1.
    SELECTION-SCREEN : END OF BLOCK blk.
    START-OF-SELECTION.
      CONCATENATE 'TERMS' id INTO tdname.
      head-tdobject   = 'TERMS'.
      head-tdname     = tdname.
      head-tdid       = id.
      head-tdspras    = sy-langu.
      head-tdlinesize = 132.
      APPEND head.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          client                        = sy-mandt
          id                            = id
          language                      = sy-langu
          name                          = tdname
          object                        = 'TERMS'
        ARCHIVE_HANDLE                = 0
        LOCAL_CAT                     = ' '
      IMPORTING
        HEADER                        =
        TABLES
          lines                         = line
       EXCEPTIONS
         id                            = 1
         language                      = 2
         name                          = 3
         not_found                     = 4
         object                        = 5
         reference_check               = 6
         wrong_access_to_archive       = 7
         OTHERS                        = 8.
      IF sy-subrc <> 0.
        CALL FUNCTION 'SAVE_TEXT'
          EXPORTING
            client                = sy-mandt
            header                = head
          INSERT                = ' '
          SAVEMODE_DIRECT       = ' '
          OWNER_SPECIFIED       = ' '
          LOCAL_CAT             = ' '
        IMPORTING
          FUNCTION              =
          NEWHEADER             =
          TABLES
            lines                 = line
         EXCEPTIONS
           id                    = 1
           language              = 2
           name                  = 3
           object                = 4
           OTHERS                = 5.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
      CALL FUNCTION 'EDIT_TEXT'
        EXPORTING
        DISPLAY             = ' '
        EDITOR_TITLE        = ' '
          header              = head
        PAGE                = ' '
        WINDOW              = ' '
          save                = 'X'
        LINE_EDITOR         = ' '
        CONTROL             = ' '
        PROGRAM             = ' '
        LOCAL_CAT           = ' '
      IMPORTING
        FUNCTION            =
        NEWHEADER           =
        RESULT              =
        TABLES
          lines               = line
       EXCEPTIONS
         id                  = 1
         language            = 2
         linesize            = 3
         name                = 4
         object              = 5
         textformat          = 6
         communication       = 7
         OTHERS              = 8.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

    CONSTANTS:
      line_length TYPE i VALUE 254.
    DATA: ok_code LIKE sy-ucomm.
    DATA:
    Create reference to the custom container
      custom_container TYPE REF TO cl_gui_custom_container,
    Create reference to the TextEdit control
      editor TYPE REF TO cl_gui_textedit,
      repid LIKE sy-repid.
    START-OF-SELECTION.
      SET SCREEN '100'.
          MODULE USER_COMMAND_0100 INPUT                                *
    MODULE user_command_0100 INPUT.
    CASE ok_code.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
    MODULE status_0100 OUTPUT.
    The TextEdit control should only be initialized the first time the
    PBO module executes
      IF editor IS INITIAL.
        repid = sy-repid.
      Create obejct for custom container
        CREATE OBJECT custom_container
          EXPORTING
            container_name              = 'MYCONTAINER1'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            others                      = 6
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      Create obejct for the TextEditor control
        CREATE OBJECT editor
          EXPORTING
             wordwrap_mode          =
                    cl_gui_textedit=>wordwrap_at_fixed_position
             wordwrap_position      = line_length
             wordwrap_to_linebreak_mode = cl_gui_textedit=>true
            parent                  = custom_container
          EXCEPTIONS
            error_cntl_create      = 1
            error_cntl_init        = 2
            error_cntl_link        = 3
            error_dp_create        = 4
            gui_type_not_supported = 5
            others                 = 6
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT

  • Using Rich Text Editor with a Custom Attribute

    Hello All,
    Can anyone please tell me as how can I use the Rich Text Editor with a Custom Attribute?
    I want to create a custom attribute based on text datatype, but when entering the value for this attribute in a Custom Item, portal shows a normal textarea. I want that the user should see the Richt Text Editor.
    Thanks for help.
    Regards

    Hi,
    Can you tell me what steps you are using to produce this, and which Portal version you are using. When I tried it, I wasn't able to reproduce it. Here are my steps:
    1) Created Custom Item Type, based on Text, under
    Page Groups > Shared Objects > Item Types
    2) Selected Three attributes (Description, Name, Publish Date). Note Text and Display Name were already selected
    3) In Add Item Wizard, configured list to allow for my
    custom item type selection.
    4) Then I was able to see the Rich Text Editor when editin
    my custom item type.
    Regards,
    J.

  • Making Rich Text Editor with PHP in Dreamweaver  - Problem with CKEditor...

    Hi,
    I am developing a website in Dreamweaver and using the platform of PHP and MYSQL. I need to develop a Rich Text Editor just like the one I am typing at the moment. With my recent searches I have come across with CKEditor as one of the possibilities to add a Rich Text Editor to my website. I have seen older versions of CKEditor also known as FCKEditor which I believe unfortunatley is out of date and obsolete now (discontinued). I cannot find any of the downloads now from anywhere on the web.
    I can find FCKEditor tutorials with PHP,  but can not find CKEditor tutorials for PHP (when I try googling it, it always gives me FCKEditor page). Can anyone please help me and tell me if I can still make Rich Text Editor using CKEditor and PHP?
    If yes, please guide me how? Any tutorials or reading material will be very helpful.
    Regards,
    Bilal . Khan

    Yes, you absolutely can use CKEditor to create a rich text editor with PHP/MySQL.I have tried several editors and it's my choice.
    Here is a link to the documentation page:
    http://docs.cksource.com/
    CKFinder is also very good in conjunction with CKEditor. Although it costs $59/per website, it's better than the free alternatives.

  • Text editor with 15 lines

    Hi all,
    I have a requirement to create a text editor.
    I created a Text editor,but where i need only 15 lines to update into it .
    But it showing 22 lines and some times 30 lines .
    Anybody let me know how to update Text editor with 30 lines .
    Regards,
    Madhavi

    solved myself

  • Using third party Rich Text Editors with Portal Release 2 (9.0.2)

    Hi Everyone,
    We would like to use some third party Rich Text editor with portal as the Oracle Rich Text editor is fairly basic and it does not fulfill our business requirements.
    Some of the things we are hoping to accomplish by through this text editor (after customizing) are:
    Ability to select any page within the portal to add as link in the Text Editor.
    Ability to select images from the portal repository.
    Create HTML Tables.
    Support of copy/paste from Microsoft Word.
    I am looking for any suggestions or experiences on how this can be done.
    Thanks in advance..
    Niraj

    Niraj,
    There's a RTE posted on knowledge exchange (with source), in my folder.
    Re: Calendar PJC on French Keyboard
    Hi Everyone,
    We would like to use some third party Rich Text editor with portal as the Oracle Rich Text editor is fairly basic and it does not fulfill our business requirements.
    Some of the things we are hoping to accomplish by through this text editor (after customizing) are:
    Ability to select any page within the portal to add as link in the Text Editor.
    Ability to select images from the portal repository.
    Create HTML Tables.
    Support of copy/paste from Microsoft Word.
    I am looking for any suggestions or experiences on how this can be done.
    Thanks in advance..
    Niraj

  • Trying to create a text item with a scroll bar in Indesign 5.5

    Is there a simple way to create a scrollable text article in Indesign 5.5? It will later be exported to a SWF as a mini-flash web portfolio.
    I would appreciate any help.
    I'm new to Indesign.

    quote:
    Originally posted by:
    wildfire121
    Can someone please help. I am trying to create a text box
    with a working scroll bar that will scroll the text in the text
    box. Can someone please help me with this?
    Do you mean a text box people can type in (for a Web form
    entry) or one for displaying your content?
    If the first, then you use the textarea tag and scrollbars
    appear when the user types more lines that you specify. See the
    textarea
    description at W3Schools.
    If the second, then that's usually done in Flash, but can be
    done with CSS. See these two pages:
    Dynamic
    text with scrollbar (Flash)
    Textbox
    with scrollbar (CSS)

  • How to create a text Component With Certain Properties

    I need to create a text component with the following properties:
    Has Capability to be italic, right/left aligned, have different background / foreground colors, and most importantly, the ability to have a fixed width and a height that is set by the amount of text in it (ie line wrapping expands the field vertically).
    It should be a simple exercise, but I cannot seem to figure out how to do it.

    Here is the correct syntax :
    private static JEditorPane constructPane(String text, int normWidth, int normHeight, boolean rightAlign, boolean italic,boolean isWhite) {
              JEditorPane pane = new JEditorPane();
              pane.setEditable(false);
              pane.setContentType("text/html");
              pane.setText(
                   "<html><head></head><body>"
                   + (italic?"<i>":"")
                   + "<table><COLGROUP><COL width=\""+normWidth+"\"><THREAD><tr><td valign=\"top\" align="+(rightAlign?"\"right\"":"\"left\"")+">"
                   + text+"</td></tr></table>"
                   + (italic?"</i>":"")
                   + "</body></html>");
              pane.setSize(normWidth,normHeight);
              if(isWhite)
                   pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1,0,1,0,Color.WHITE),BorderFactory.createEmptyBorder(0,1,0,1)));
                   pane.setForeground(Color.WHITE);
              else {
                   pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1,0,1,0,Color.BLACK),BorderFactory.createEmptyBorder(0,1,0,1)));
                   pane.setForeground(Color.BLACK);
              return pane;
         }

  • Create Oracle Text stoplist in Java with PL/SQL

    Hi, I need help with this
    I do connection Oracle database with Java by using JDBC. I need create stoplist in my
    Oracle Text application that I create with PL/SQL procedure. I want to add stopwords to
    this stoplist directly in Java therefore I must create this procedure in Java.
    This procedure is:
    begin
    ctx_ddl.create_stoplist('mystop', 'BASIC_STOPLIST');
    ctx_ddl.add_stopclass('mystop', 'NUMBER');
    ctx_ddl.add_stopword('mystop', 'word1');
    end;
    CTX_DDL is package in Oracle Text. This procedure runs functions directly on Oracle no
    problems. I don´t know - how create this procedure in Java and run this in Oracle by
    using JDBC. Can you anybody help, please?

    > The problem is that we have a compatibility problem with LDAP. When I try to retrieve information
    in LDAP, I have strange characters that appears instead of accents like é,è,ë or whatever... someone
    in my developement team has the same problem and he solved it using java.naming.ldap.version and put
    it in version 2. The problem is that he developed in Java and I am in PL/SQL. That's the problem...
    No. That is not the problem.
    The problem is that you have no clue what the problem is, and now jump at the first available thing that seems to be a solution for this unknown problem. And who knows just how many other problems this so-called solution will now introduce... never mind whether or not the root cause of the original problem will be solved by this solution.
    Software engineering does not work like this.
    Software engineering says:  Identify the Problem.
      Analyse the Problem.
      Solve the ProblemAll you have identified is a symptom of some problem. A character set issue. How about identifying the actual problem and then solving that problem comprehensively?

  • Rich Text Editor with Custom Text Attribute

    Hello All,
    We are using the latest version of Oracle Portal 10G. I have a need to create custom Attributes of the type text to let people enter a lot of text. But when User are in edit mode of an item where this custom attribute is used, the Rich Text Editor is not shown for entering the Text for the Custom Text Attribute. It shows a normal html text area. Has anyone ever used RTE with Custom Attribute?
    I request you guys for help.
    Thanks.

    The Problem with the Custom Attribute is not solved, but I have now compromised with the Situation and now I am not using a Custom attribute.
    Rather, Now I am creating a Custom Item Type using Base Text Type (earlier i wanted to create custom item type at my own without any base item type). In this case now I will not be able to change the Lable of the RTE (that is "Text", when the Custom Item is in Edit Mode), but I hope that my users can understand that much.
    I have created a template for portal pages. In the Template I can edit the Region Properties. When I edit the Region property of the region where I want to display my Custom Items. I get two Tabs on the top, Main and Attributes/Style. ON the main tab I can tell what type of region it should be, width etc, in my case it is item type region. And on the Attributes/Style tab, I can select from the availabe Attributes as which all Attributes I want to display. Here if i select only "Associated Functions" Attribute then normally portal should not render anything by default on the Page. It should rather make a call to the procedure which is associated with the Custom Item and as when I was creating the custom item type, I had clicked on "Display Procedure Results With Item", so portal should now display the result of my Procedure. So far it works without problem.
    But the problem is that the Portal displays the text at its own also. As i have written that Portal should not display anything at its own, this doesn't work in this version of Portal for a Custom Item Type that is made using Base Text Item Type. For all others it has worked till now (I have create 50s of Custom item types).
    You can better understand by going to the following URL. Just have a look between the two dotted lines (Dotted line is also a seperate Custom Item Type). Between the two Dotted Lines is a custom item, in general it would be a Custom News Item having title, image and so on.
    http://sunnode1.edvz.sbg.ac.at:7778/portal/page?_pageid=79,56047&_dad=portal&_schema=PORTAL
    I have really programmed a lot with portal but now at this stage where I am near to end, I am getting problems which are coming from Product. I request you for help.

  • How to create a text file with data.

    Hi,
    I am writing java code for testing an application, some times test can failed in some cases, I want to display an error message in text file. To that I written the code as like,
    BufferedWriter bout;
    bout =new BufferedWriter(new FileWriter("test.txt"));
    String str=”Your input data is not match with pattern”
    bout.write(str);but here it is creating a text file “ test” without any data in it.
    Can any body help that to execute the program properly
    Regards
    Buntty

    sabre150 wrote:
    JoachimSauer wrote:
    You didn't close your BufferedWriter. Since it's buffered it probably didn't write anything to the underlying file.
    Generally you must close every Writer/OutputStream that you no longer use or it won't be written reliably.It's not quite as simple as that. If you have a chain of Writers / OutputStreams then you only have to close() the outer most one since each is responsible for closing any Writer/OutputStream that it wraps. If you do decide to close them individually (a bad idea but people do do it) then you MUST close them starting from the outer most one and working to the most inner one or you will not guarantee to flush any buffered content.Of course. I might have used a misleading phrasing here. What I meant is "Every time you are done with a Writer, you must close it" and not "You must close *every* Writer that you used". Thanks for the clarification.

  • [How?] Text editor with hidden data

    Im looking on a good way to make an small Text editor (visually the features of a JTextPane is ok for my needs), but I need to associate metadata with words or a group or words (ex. timestamps).
    Any idea on how to accomplish this ?
    thanks

    SB. wrote:
    I think that it's too soon to think on how to store those data. Once the editor designed, I could save the information in an xml, serialized class etc.. it doesnt really matter.
    The easy part is to design all my classes to represents those Strings + metadata (my model).
    I suppose that after that I could convert them to a document which I can use to display in any gui. BUT if I can't fit all those infos in a widget, I'll have to catch all keyboards/mouse events et manually apply those modifications on my model beforce creating new document to refresh the widget ? That part seem problematic to me..Huh?
    You have a data structure. That data structure is mapped to a displayable format.
    For example you could use XML for the data structure. Thus something like the following would be in it.
           <Line font="bold">
                 <priority>3</priority>
                 <text>This is a line</text>
           </Line>You then create a mapper that takes that and displays the value of the element "text" to the screen. Nothing else is displayed from that is displayed.. Your display mechanism would need to have a link between that line and the above xml so if someone changes that line then it gets put back in the xml.
    In the above "priority" and "bold" simply represent other data type elements the rules of which depend on the needs of your application.
    Note that the above depends on rules which might or might not be represented in the data structure. Maybe because they can't be or simply because it isn't worth the effort.
    For instance what happens if the user puts a line feed in the middle of the displayed line? Does that create a new "Line" entity or is just an update to the existing "text" element?
    Keep mind that XML is nothing but an example there are other ways to do this.

  • Wondering how to create a text box with variables...

    Hi everyone,
    I was wondering how to create a text box, that at the beginning of the presentation, the audience fills in regarding what they think constitutes the role they have been chosen for.
    I would like that same box to then appear at the end of the presentation, with the text they typed in at the beginning, so they can reflect on what they think now, and what they thought then. I understand this is done using variables, but i'm not 100% sure.
    I hope I've worded this okay!

    This screenshot shows the properties panel, Style tab for the TEB. I relabeled it to My_TEB, used the X button  to create a user variable v_choice that will replace the generic Text_Entry_Box_1/
    This is the properties panel of a Shape, I went in Edit mode (double clicking)to make the Character section appear, where you find the X button. It opens the dialog box 'Insert Variable' and you can choose the var associated with the TEB. The Maximum Length will define how many characters will be displayed, the value of a variable has maximum 256 characters.

  • Create new oracle database with JAVA

    Hi!
    I would appreciated it if you could help me to solve a problem that i have.
    I am trying to create a new oracle database by a JAVA 1.4.2 application. I am using the scripts that Oracle 10.g supplies during the creation of a new database from the server (Generate Database Creation Scripts) with the appropriate changes, generated by a java application. Unfortunately, i am unable to connect with the database and the listener. Is there any other way to create a new database by java and how can i solve my current problem with the oracle scripts?
    Thank you.

    A) To create a new schema, you need to be connected as a user that has create schema privilege, or as tyhe user who is to own the schema (remembering that the user has appropriate create privs, as seen in the GRANT command in the SQL Reference manual). Not an issue at all, I think, if you coordinate this with your DBA. Discussed very well in the Administrator's manual.
    B) Alternately, you could create a complete copy of the schema, including all desired objects (tables, views, etc.) in a separate database and simply export the user and schema. Then simply invoke the OS-based import command (imp) to load that entire thing into the target database.
    C) To create a new database, there are 3 simple steps ...
    1) create the appropriate initialization parameter file
    the init{sid}.ora file should be placed in the $ORACLE_HOME/dbs or %ORACLE_HOME%\database directory. (I recommend you do not attempt to create the spfile.) Of critical interest will be setting the block size information, the control file parameters, and using the appropriate memory management parameters, based on the version of the software you will be using to create the database instance.
    2) start an empty instance, pointing to the parameter file
    This will be an OS specific call, and will require that you have the correct OS environment set up as well as access to the ORACLE_HOME which will provide the software that you will invoke. In *nix you will need to call the sqlplus command with sysdba provs and in Windows you will need to call oradim to initialize this as a service.
    3) run the SQL create database command
    You might want to use the dbca to create a template of the create database command, or look in the SQL Reference manual for the variations on the command. Of critical interest will be initializing the redo logs as well as the system, sysaux (if needed), temp and undo tablespaces after which you can set up the regular tablespaces, users and schemas. I highly recommend that you have redundant copies of the control files on separate drives.
    You may want to review the online Concepts manual and the Adminstration Guide for some of the specifics to your needs, but I think I've covered the basics.
    Remember that ideally you will only have one database instantiated on any given server as the memory and CPU overhead of each instance is significant.
    Good luck.

  • How to create a SAS Dataset with Java

    Hello All,
    The subject line says it all. Does anyone out there know how to create a SAS Dataset using Java? I Googled it and searched here with no luck.
    Thanks
    KP

    Some parts of SAS appear to have been exposed via a Java API through this product:
    http://support.sas.com/rnd/app/da/workshop/faq.html
    Hope that helps
    Lee

Maybe you are looking for

  • Thumbnail view is not availabe on fresh install -- kde 4.5 [SOLVED]

    Hello, I've just reinstalled kde4.5 as minimal desktop. Everthing works great except in desktop folder the image preview mode is not working. Only icon view is available. Could anyone help me figuring out what could be wrong? Perhaps, I forgot to ins

  • Oracle 8 installation in Windows 2000 Server

    I can't install oracle Enterprise Manager (Oracle 8 product) in a Windows 2000 Server system. The installation program show me this error message: "Unable to delete the NT Service for the SQL * NT V2 listener" Can any body have the solution?

  • Older version of itunes cant delete from pc new version not installed

    trying to installed latest version iTunes64 1115.exe but older version cannot be remove from pc already older version downloaded and try to installed with no sucess. pl advice

  • Query for 3 tables.

    Hi, I need to write a SELECT statement that returns one row for each customer that has orders with the following columns: ====================================================================== Email addresses from Customers Table Sum of the Item Pric

  • First import was 16:9, second try 4:3 WHY???

    I imported a new DV movie in 16:9 (widescreen) format. First it imported in 4:3 and it changed to 16:9. I than imported a second movie, same way it imported in 4:3 but never changed to 16:9. WHY??? I saved my imported movie as a movieproject format.