How to add a text area in a Content pane..?

Hi,
I created a content pane with 5 buttons. One of them is a quit button, and I was able to create an "system.exit(0)" event handling for him. My problem is.. I have 4 other buttons, and I want them to show some text when I click them. How do I add a text area bellow my content pane..?
Copy/paste my code to see what im talking about :) :
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Interface extends JFrame {
public Interface() {
Container contentPane = getContentPane();
contentPane.setLayout(new FlowLayout());
JButton button1 = new JButton("Test1");
JButton button2 = new JButton("Test2");
JButton button3 = new JButton("Test3");
JButton button4 = new JButton("Test4");
JButton button5 = new JButton("Quit");
ButtonHandler handler = new ButtonHandler();
button5.addActionListener( handler );
contentPane.add(button1);
contentPane.add(button2);
contentPane.add(button3);
contentPane.add(button4);
contentPane.add(button5);
contentPane.setBackground(Color.orange);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
public static void main(String args[]) {
Interface window = new Interface();
window.setLocation(250,350);
window.setTitle("FlowLayout");
window.pack();
window.setTitle("Test");
window.setVisible(true);
public class ButtonHandler implements ActionListener {
public void actionPerformed( ActionEvent e )
System.exit(0);
Thanks alot! :)

By default the content pane of the JFrame uses a Border Layout. So you should:
1) Create a JPanel
2) Set the layout of the JPanel to FlowLayout
3) add the buttons to the panel
4) add the panel to the content pane
5) add your text area to the content pane
Read this section from the Swing tutorial on "Using Layout Managers":
http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html

Similar Messages

  • How to add new text field in standard report

    how to add new text field in standard report?

    Hi,
    I presume you are talking about a report display in ALV and u wish to add a column to it .
    If it is a global requirement ,as in table being used there in ALV can be modified, then you can append the table and the system should pick up the same automatically from there.
    Otherwise , you can make a Z program . Modify the catalog being used in ALV.
    Regards,
    Shweta

  • How to add standard text in PO and how it is maintained ?

    How to add standard text (paragraph) in PO and how it is maintained ?

    Hi
    Please go through this document.which has a step by step
    Working with Frequently Used Texts
    Use
    You can copy texts from various sources to create PO texts:
    Standard texts
    Certain standard texts are supplied with the system and can be assigned to a purchasing document in Customizing.
    The content of some standard texts is predefined by your system administrator.
    You can also create standard texts yourself and copy them into purchasing documents.
    Master records
    Database fields
    Activities
    Creating Standard Texts
    You can create your own standard texts via Tools ® SAPscript ® Standard text.
    Inserting Standard Texts
    You can insert your standard text on the long text screen via Insert ® Text ® Standard.
    For more information, refer to the Basis documentation under BC Word Processing with the SAPscript Editor:  Including Texts.
    You can display the print preview via Text ® Print ® Print preview.
    Inserting Texts from the Master Record
    There are three ways of linking texts from a master record with a purchasing document. The relevant settings are made for each text type in Customizing for Purchasing. The indicator in the status column shows the nature of the linkage.
    Option                                              Indicator in status column
    The text is copied:               
    It is then independent of the text                 None
    in the master record. Changes to
    the text in the material master record
    have no influence on the text in the document.
    The text is displayed only:
    It cannot be adopted.                                          N
    The text is offered for copying:
    It can be copied via Header or Item ® Texts ® Adopt text. (In requisitions: Goto ® Texts ® Adopt text.) Changes made in the master record will also be adopted in the document until such time as you copy the text.
    Inserting Texts from Database Fields
    You can include the content of a database field at any point in the text on the long text screen. A value specific to the relevant document is displayed in the printed document.
    Choose Insert ® Symbols ® Program symbols.
    Choose DDIC fields.
    Search for the relevant table/structure (in the case of PO items, this is EKPO) and then choose ENTER .
    Choose the relevant table field.
    Choose Text ® Print preview to see the print preview.
    Reward if useful
    Aasif

  • How to add standard text in smartforms?

    Hi friends,
    How to add standard text in smartforms ?
    points rewarded soon
    Regards
    RH

    Creating the Standard Text:
    Go to SO10
    1. Enter Text Name.  For example, ZABC
    2. Text ID ST
    3. Language EN
    Click on Create.
    And enter the Required Information and save.
    To include a Standard text in SmartForm.
    Follow the steps below:
    1. Create a text node in the window.
    2. Under general attributes select "Include text" as Type.
    3. Specify the fields under Text.
    Text Name ZABC
    Text Object TEXT
    Text ID ST
    Language EN.
    Hope it helps.
    Regards.

  • How to add a text box in the layout (View)

    How to add a text box in the layout (View)

    Hi.
    Right Click in the RootUIElement container.
    Click Insert Element.
    Give Name: Input
    Type : Input Field.
    Press Enter.
    Regards
    Bala.

  • I want to know how to clear the text area by the push off my next question button and ask a new ques

    I want to know how to clear the text area by the push off my next question button and ask a new question - also I want to know how to code in my project to where a user can enter a math question in one border container and the answer enters into the next container
    heres my code so far
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" backgroundColor="#1E5C75">
        <fx:Script>
            <![CDATA[
                protected function button1_clickHandler(event:MouseEvent):void
                    //convert text area into labelid to be identified by actionscript
                    richTextLabel.text = myArea.text;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <!--container 1-->
        <s:BorderContainer borderWeight="7" x="28" y="10" width="200" height="138">
            <s:layout>
                <s:VerticalLayout paddingTop="10" paddingBottom="10"
                                  paddingLeft="10" paddingRight="10"/>
            </s:layout>
            <!--data Entry control-->
            <s:TextArea id="myArea" width="153" height="68"/>
            <!--end of data entry control-->
            <s:Button width="151" label="ask a question" click="button1_clickHandler(event)"/>
        </s:BorderContainer>
        <!--container2-->
        <s:BorderContainer borderWeight="7" x="509" y="10" width="200" height="138">
            <s:layout>
                <s:VerticalLayout paddingTop="10" paddingBottom="10"
                                  paddingLeft="10" paddingRight="10"/>
            </s:layout>
    <!--data entry control-->
            <!--convert tne data entry control into a label id in actionscript-->
            <s:Label id="richTextLabel" width="153" height="68"/>
            <s:Button width="151" label="next question" click="button1_clickHandler(event)"/>
        </s:BorderContainer>
        </s:Application>

    This is a user to user support forum.  We are all iphone users just like you.
    You are not addressing Apple here at all.
    This is an odd way to ask your fellow iphone users for help. Berating oterh users will not help you.
    "it's too fragile"
    No it is not.  i have never damaged one, nor has anyone I know.
    " U loose data when Ur phone is locked"
    No you don't.  Why do you think this?
    "and there is no customer support!!!  "
    Wrong yet again.  Apple has an 800 number and they have many retail stores and they have support articles that you can access using the search bar. Or you can contact them throgh express lane online
    "but I will go back with Blackberry "
    Please do.
    Good ridance

  • How can I find text-item description and content in database?

    I make "Actual news" region with text and simple image items.
    With "Custom Search" autoquery I make news portlet with 10 latest news.
    But I will make with PDK-Java discussion portlet, in which users can read and write about last published (last created text item display name and content) news.
    My questions:
    - How can I find text-item description and content in database?
    - How I can sort text-items to find latest created in my region?
    I have Portal R2
    Thanks in advance.
    Cheslav

    I am sorry. The following are the related tables.
    WWV_TEXT
    WWV_TEXT_BLOCKS
    WWV_TEXT_BLOCK_USAGES
    WWV_USER_TEXT_BLOCKS
    WWV_USER_TEXT_BLOCKS$
    WWV_USER_TEXT_BLOCK_USAGES
    WWV_USER_TEXT_BLOCK_USAGES$
    May be you want to browse WWV_TEXT which is the core table.

  • Rejection Applicant: How to add plain text to the mail E Mail Letter?

    Dear All:
    I'm working with a ECC6 version.
    In transaction PB60, when we do the candidate rejection activity, the E Mail letter generates a mail with empty body text, and an attachment with the letter in PDF format. The letter is OK, but I would like to know how to add some plain text to this E Mail letter. An empty mail is not a good practise.
    I searched across the forums and SAP documentation, but I could not find any clue.
    I would appreciate any help regarding to this matter.
    Best regards
    Jordi

    Here you go !  ( you need to create Text in t-code SO10 for ID = PAML " )
    Two Default texts under  ID = PAML :
    *MAIL-APP-INTERVIEW     *EN     TEXT     PAML     SYSTEM
    MAIL-APPLICANT     EN     TEXT     PAML     SYSTEM
      Personnel Management->Applicant Activities->Mail Connection ->Create standard texts for mail connection
    Create standard texts for mail connection
    In this step you can create the standard texts to be used in mails.
    Example
    u2022     Request for return of applicant file
    u2022     Notification of date of job interview
    Requirements
    u2022     You should have assigned a standard text to the activity.
    u2022     You should also have set the variables which are to be used.
    u2022     Finally, you should also have made the settings for supplying the variable with values.
    Standard settings
    The standard system contains two examples of standard texts. You can use these examples as references to help you create your own standard texts. The standard texts have the following names:
    u2022     MAIL-APPLICANT (note on an applicant activity)
    u2022     MAIL-APP-INTERVIEW (note on appointment for interview)
    Please note that the standard texts are stored under text ID PAML.
    Activities
    Now create the standard texts you require under text ID PAML.
    Further notes
    Every mail is made up of a heading and contents. In the first line of the standard text you enter the heading of the mail and from the second line on, the contents.
    The standard default settings for style and layout are used for mails.
    The SAP System treats standard texts as application data. This is why there is no automatic connection to the transport system. If you want to copy texts from one client to another within the same system, please use the functions of the transaction to create the texts. If you want to send the texts to a different system, please enter the transport manually as follows:
    PgmID   Obj     Objectname
    R3TR    TEXT   TEXT,XYZ,PAML,E
                     |    |   |   --- Language (e.g. E for English)
                     |    |   -
    Text ID (e.g. PAML for standard mails)
                     |    -
    Text name (probably not XYZ)
    Text object (TEXT ist fixed)
    Good luck
    Saquib Khan

  • How can add some text on the image

    I have images in the gif format.
    How can I add some text in specified point on the image?
    Fpor example, by using Intermedia plugins?

    We do not support this functionality. I suspect you are talking about watermarking?
    I would suggest you send a message to [email protected] , the product manager for interMedia and describe your application. This would be helpful in defining future requirements. He may also know of partners that can supply this technology.
    You can add text to an image using JAI or some other packages before the image goes into the database, or when it goes out.
    Larry

  • How to add after "text-016 qmel-qmnum " "text-017 qmel-kunum text-018"

    How could I  add after "text-016 qmel-qmnum " "text-017 qmel-kunum text-018" in a NEW LINE in code
    CONCATENATE  text-016 qmel-qmnum text-017 qmel-kunum text-018
    qmel-qmtxt
    text-019 qmel-priok
    INTO
    objtxt

    Hi
    str1 and str2 are char variables
    first use
    CONCATENATE text-016 qmel-qmnum text-017 into some str1.
    then
    CONCATENATE text-017 qmel-kunum text-018 into another str2.
    then you can use these 2 varaibles as per your requirement
    Regards
    Anji

  • How to add a text Component ( text annotation) to the Tiff Image

    Hi.............
    This is the first time I am using Sun Developers Forum.......................
    My problem is.............I want to add a component ( Text or Label ) to the Tiff Image which is displayed on the JIMICanavs [ from JIMI API ].
    Even , if anybody knows about How to add a component to the JIMICanavs , Please help me..................................

    I'm curious: is JIMI still popular? What advantange does it have over the current Java 2D support in the J2SE, or over JAI?

  • How to add new text and an empty space before a file name with Automator

    I can create a new service to add to multiple files some text before the file name but I need to add even an empty space; e.g. file name original  becomes: new text(space)file name original. The aim is to add this text and space to multiple files.
    I hope to be understood. Please can somebody help me?
    Thanks

    This is an old Apple-supplied AppleScript that will do the job.
    IMPORTANT: note the conditions of use: it will choose the frontmost Finder window to operate on. Therefore, open the folder you want to change the names of and make it the front finder window BEFORE running the script.
    Add to File Names
    This script is designed to add a prefix or suffix to files in the front window of the desktop.
    If no folder windows are open, the script will affect items on the desktop.
    Copyright © 2001–2007 Apple Inc.
    You may incorporate this Apple sample code into your program(s) without
    restriction.  This Apple sample code has been provided "AS IS" and the
    responsibility for its operation is yours.  You are not permitted to
    redistribute this Apple sample code as "Apple sample code" after having
    made changes.  If you're going to redistribute the code, we require
    that you make it clear that the code was descended from Apple sample
    code, but that you've made changes.
    --March 2014: Changes by Phil Stokes to make the script work on 10.9
    --these changes are simply reversing the order of parameters in the lines that have "copy" in them
    -- The following line is disabled due to a Menu Manager bug
    --set the source_folder to (choose folder with prompt "Pick the folder containing the files to rename:")
    try
              tell application "Finder" to set the source_folder to (folder of the front window) as alias
    on error -- no open folder windows
              set the source_folder to path to desktop folder as alias
    end try
    set the prefix_or_suffix to ""
    repeat
              display dialog "Enter the prefix or suffix to use:" default answer the prefix_or_suffix buttons {"Cancel", "Prefix", "Suffix"}
              copy the result as list to {button_pressed, prefix_or_suffix}
              if the prefix_or_suffix is not "" then exit repeat
    end repeat
    set the item_list to list folder source_folder without invisibles
    set source_folder to source_folder as string
    repeat with i from 1 to number of items in the item_list
              set this_item to item i of the item_list
              set this_item to (source_folder & this_item) as alias
              set this_info to info for this_item
              set the current_name to the name of this_info
              if folder of this_info is false and ¬
                        alias of this_info is false then
                        if the button_pressed is "Prefix" then
                                  set the new_file_name to the (the prefix_or_suffix & the current_name) as string
                        else
                                  set the new_file_name to the (the current_name & the prefix_or_suffix) as string
                        end if
                        my set_item_name(this_item, the new_file_name)
              end if
    end repeat
    beep 2
    on set_item_name(this_item, new_item_name)
              tell application "Finder"
      --activate
                        set the parent_container_path to (the container of this_item) as text
                        if not (exists item (the parent_container_path & new_item_name)) then
                                  try
                                            set the name of this_item to new_item_name
                                  on error the error_message number the error_number
                                            if the error_number is -59 then
                                                      set the error_message to "This name contains improper characters, such as a colon (:)."
                                            else --the suggested name is too long
                                                      set the error_message to error_message -- "The name is more than 31 characters long."
                                            end if
      --beep
                                            tell me to display dialog the error_message default answer new_item_name buttons {"Cancel", "Skip", "OK"} default button 3
                                            copy the result as list to {button_pressed, new_item_name}
                                            if the button_pressed is "Skip" then return 0
                                            my set_item_name(this_item, new_item_name)
                                  end try
                        else --the name already exists
      --beep
                                  tell me to display dialog "This name is already taken, please rename." default answer new_item_name buttons {"Cancel", "Skip", "OK"} default button 3
                                  copy the result as list to {button_pressed, new_item_name}
                                  if the button_pressed is "Skip" then return 0
                                  my set_item_name(this_item, new_item_name)
                        end if
              end tell
    end set_item_name

  • How to add custom text on ISA B2B Order

    Hi,
    On Order page of ISA B2B I have created a custom text field  "Shipping Attention".When I try to add this text in the header like
    header.addExtensionData("Z123","Value") in Z_BasketRefreshAction which extends MaintainBasketDispatcherAction, it is not reflecting in the "Shipping Attn"(created in the text tab in CRM)  field in CRM system.
    The flow:
    /b2b/maintainbasket --> Z_BasketRefreshAction --> /b2b/basketrefresh --> MaintainBasketRefreshAction --> b2b/updatedocumentview
    Please let me know if I missing something...
    Thanks in Advance.
    Regards,
    Muthu

    Hello,
    You have covered the first two layers of the request - response cycle cake - the View (JSP) and the Control (Java) layers. The icing is done in the backend BAdI and using the right function module. I am assuming the CRM backend.
    A typical request-response in the application goes like this. I will give example for the header extensions.
    Added the custom variable in the HTML layer (JSP page)
    Traversed through the Dispatcher, Parser and get the input value from the JSP page variable and added it to the Business Object (Header) using addExtensionData.
    The java application layer actually makes an "Update Header" call during the update cycle - like when you click that "Update" button.
    In the SAP E-Commerce design, during this "update" cycles, the application flows through specific BAdI call sequence. It calls what I call the Header BAdI CRM_ISA_BASKET_HEAD when the header information is updated. You have to extend this BAdI and implement at least two methods.
    It has two methods - which are called during this request - response cycle. First method CHANGEHEAD_SET_DATA is called during the request cycle - that is from ISA to CRM (when update is clicked). This is where your extension data has to be transferred from the Java layer to the backend layer (model). You will essentially read from the table IT_EXTENSION and call SAVE_TEXT function module. Since your requirement is to update text, this is the FM to be called. Many other cases use the FM mentioned by Mike. This is where the data from the web layer is persisted in the backend model.
    And the other method GETHEAD_GET_DATA is called during the response cycle. In this method, you will essentially read from the model - in your case READ_TEXT and set it back in the extension layer CT_EXTENSION
    The update header call from the Java layer will now receive the data back from the model and will automagically transfer the values from the backend (ABAP layer) back to the Java layer to be accessible by you in the JSP using getExtensionData call.
    What you have to do are the steps .5 and 6 in order to complete the request-response cycle.
    Easwar Ram
    http://www.parxlns.com

  • How to Create Free Text Area

    Hi all,
    I have a requirement where i need to create some 70 Z-fields inside Incident line item where user just enters data and will save the form.
    i have achived this by adding the fields into ORDERADM_I and is working fine.. i am able to bring the fields in the Incident line item.
    Now i have a requirement where i need to create 2 Free Text areas (like notes where user can enter unlimited text) .
    how to achive this.
    as of now i have created 2 more Z-fields in ORDERADM_I with 255 characters length and increased the line numbers into 4 in the GET_P method. but by doing this, user can enter only 255 characters and this is not a free text area.
    can any one give me steps to create a new free text area.
    Regards,
    Amshu

    Hi Steve,
    i have already tried this. it works fine
    look at my code below
    method GET_P_ZZAFLD0000AL.
      CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_textarea.
        WHEN if_bsp_wd_model_setter_getter=>fp_textarea_rows.
          rv_value = 4.
      ENDCASE.
    endmethod.
    this code will make the field as text area with size 4 lines . But the field length will be same as what we declare in the domine.. (max 256) . i cant enter unlimited text in this field though it looks like a text area.
    i guess v need to create a standard text somewhere in configuration and assign the same here...
    if anyone hv worked on this please revert back
    Regards
    Amshu

  • How to add package text to smartform

    Hi,
    i'm new to SAP and I have a question. We have smartform with material number and material text output. We also have package number - in what this material gets packed (palette, case etc.) Now we want to add also package text to smartform.
    How to include package text from table?
    Thanks

    Hi,
    i'm new to SAP and I have a question. We have smartform with material number and material text output. We also have package number - in what this material gets packed (palette, case etc.) Now we want to add also package text to smartform.
    How to include package text from table?
    Thanks

Maybe you are looking for