Make text areas and textfields streach as window resizes

im using the border layout for most of my panels. how do i make text areas and textfields stretch as the window resizes?

Components placed in BorderLayout.CENTER will resize as the window resizes.
You will likely need to have nested JPanels, with different layouts, to create the ultimate layout of all your components in a frame, especially for non-trivial applications.
If you need specific help with layouts, you'll have to post an SSCCE.

Similar Messages

  • When I type I cannot add text when I select the text area and double click. Why?

    When I type I cannot add text when I select the text area and double click. Why?

    Premiere Elements 11  trial version for macMac computer photos uploaded to the timeline just finetrying to make a new title, streaming or in a framedouble clicked on the text in the box and nothing shows up when I type on my keyboard. I can delete the words that are there but not type in new ones. I selected the type and size, etc.
    Thanks if you can figure it out. I gave up!
    I may just un-install it all together if I can't get to work.Joanne
    Date: Thu, 9 May 2013 17:59:08 -0700
    From: [email protected]
    To: [email protected]
    Subject: When I type I cannot add text when I select the text area and double click. Why?
        Re: When I type I cannot add text when I select the text area and double click. Why?
        created by A.T. Romano in Premiere Elements - View the full discussion
    Joanne Murray J2 What version of Premiere Elements are you using and on what operating system (including 32 or 64 bit) is your Premiere Elements installed? Forgive the questions if you have been there and done that, but I do not want to take anything for granted that might hinder a speedy resolution to your issue. Are you opening an already created title that is sitting on the Timeline in order to edit it in the Titler or are you trying to create a new Title (Default Text or other)? Do you know how to work with the Selection Tool and Type Tool in the Titler? Once I know what version of Premiere Elements that you are using, I will give you specific how to details. Thanks. ATR
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5307494#5307494
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5307494#5307494
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5307494#5307494. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Premiere Elements by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How can I change a PDF document to have an enlarged text area and smaller margins?

    I've just been reading a long discussion initiated by a guy who wanted to recompose a PDF file to print in fewer pages. I'm not asking about that. I'm aware that Acrobat Pro 9 will not recompose the pages of a pdf for you; as someone said, it's not a word processing program. I want to copy a PDF to a new file with an enlarged text area and smaller margins, so I can read it more easily. My eyesight isn't so great.
    I'm trying to print a decision of the US Supreme Court, for my study. The problem is that these PDF files of such decisions are composed in 10-point type with generous margins, in folio-size pages smaller than 8 1/2 x 11". When you open PDF files of these decisions, you get extremely wide margins and relatively small type. Essentially, I'd like to re-rasterize the document so it prints on my 8 1/2 x 11" paper in a larger apparent type size, but in the same high resolution as the original. By the way, the decision I'm working on is almost 200 pages long, so I don't want to do this, obviously, in a page by page manner.  
    I guess I could do this in Photoshop, by blowing pages up and cropping them. Photoshop does a good job of eliminating the jaggies when you do this. But it would seem better to re-rasterize the pages from the PDF source file. So would any reader be kind enough to explain this process to me? (I'm fairly savvy in Photoshop, Illustrator, and computer printer concepts, but a complete newb in Acrobat.)

    If you just want this for printing, one thing you can easily do is crop all of the pages to remove the margins. For example, you can rop 2" off the left and right sides, and 1.5" off the top and bottom. Then print using a Page Scaling of "Fit to Printable Area".
    To crop in Acrobat 9, select: Document > Crop Pages
    be sure to select All for the Page Range.

  • Text area and UIScrollbar - CS3/AS2

    I have a problem with the UIScrollbar component not being
    visible when the movie is generated in CS3/AS2.
    Following the method shown in
    this
    TechNote, the scrollbar displays correctly when the text area
    is the only frame in a movie.
    In the real movie I'm working on, however, the text area is
    in a library item. In that item's definition, I've dragged the
    scrollbar onto the area and the component's targetinstancename
    parameter shows the correct name of the text area. But while the
    text area displays when I preview the movie, the scrollbar is
    invisible. Making it more puzzling, if I guess where it is, I can
    drag it.
    Any thoughts?
    John

    I tried this but the text looks warped and much different than it should. Seems anyway I embed it in the properties panel looks this way.. any other options??

  • Text area and Word Wrapping

    I am creating a email form and am having problems with word
    wraping in the text area. You can view the page and the output if
    you put your email address in the form. The problem is the text
    areas word wrap when inputting your information but all formatting
    is lost in the email. Even if I add spacing for paragraphs. All
    data is just a big run on sentence.
    Here is the
    Page.
    I am using Dreamweaver * and php.
    Thanks

    Someone may have tried this because I received this output in
    an email. You can see the formattint is lost.
    Gear Ad:
    Description:
    This is a test. Line 1 Line 2 Line 3 Line 4 -
    Test...test...test...test...test...test...test...test...test...test...test...test...test. ..test...test...test...test...test...test...test...test...test...test...test...test...test ...done!
    Price:
    test
    Contact:
    This is a test.

  • Display Text Area and Text field in same line

    All,
    Please help with this scenario.
    I have 3-4 text fields, which are all on NEW LINE. I want a text area adjacent to these 4 fields.
    How to achieve this.
    Thanks and Regards,

    Hi,
    OK - My Textarea item is immediately after the first normal Text item in sequence numbers (the first item is sequence 10 on my page and my textarea item is sequence 15).
    The only settings I changed on my TextArea item are:
    Begin on new line: No
    HTML Table Cell Attributes (Element section): rowspan=4
    This second setting merges together 4 table cells in one column into a single cell
    Andy

  • Use gvim to edit text areas and get it to use javascript.vim syntax file

    I have had a lot of trouble with javascript and editting files via apex's "javascript" sections in the page.
    The font in firefox did not distinguish various braces well enough for me. I kept accidentally mixing curly braces and parens... And I would now and then put the plsql concatenate operator || instead of the javascript +. Bleah! There are SO many ways to completely break javascript. And the whole javascript herd goes down when just one little function anywhere in there has an errant brace or quote. So I started resenting not using my customary text editor gvim. I have to have this stuff colorized and have showmatch turned on!
    So anyway I found that you can edit textareas with gvim, I don't know if this is commonly known or not so
    I thought I'd mention it. Or you can use whatever editor you want.
    I only tried this on windows but theoretically it works on other operating systems modulo you
    adjusting the shell details appropriately.
    First of all install the"It's all text!' firefox extension and restart firefox.
    then create a batch file something like this:
    (NB: don't call a batch file the same name as an executable. That can cause pesky loops :-)
    gvimrun.bat:
    c:\vim\vim73\gvim.exe %1 -c "set filetype=javascript"
    Note the pathname to gvim.exe needs to be customized. Note the parameter for passing the first argument along. (%1) The set filetype is telling it effectively to use the c:\vim\vim73\syntax\javascript.vim file.
    so then when you bring up your page in apex , when you put the mouse cursor right below the
    down arrow of the vertical scrollbar on the rhs of the textarea, you should see a little blue button
    that says "edit". Then right click and choose preferences. Direct it to your batch file.
    And if all is well it will work and invoke gvim with syntax coloring. Which makes it just a tiny bit less likely to really flub it.
    Now if anyone else wants to pick up the baton and figure out how to get more than one syntax
    in effect such as javascript and jquery? I did find a jquery.vim file out there. ...
    Now that we know how to do this if someone knows some really super great javascript /jquery
    editor that might be way better than gvim I would definitely consider that! Javascript is easy to screw up
    Edited by: lake on Jan 2, 2011 11:34 AM

    Hi Mathan. Here is something i have trying to do. This vi does not write it correct... and have I done something wrongly or "stupidly" in code
    Problems:
    -Second row is inroccet
    -If i know that device returns array where is 10 elements. Can I trust that and just return 10 elements from array and changed it to string?
    -Can I trust queue in this way?
    I think hardest in labview coding is that you dont know what kind component you should use and what is the right way to use them.
    Attachments:
    array to file.vi ‏21 KB

  • In secondary window texts are not appeaerd in smartform

    hi to all
      bfore main window,i create one window for header data.
    in this window only texts are there.
       in main window item data is dere.
    item data was appeared in main window.
    but in header data window header texts were not appeaerd,so
    plz giv me idea.
      in that window, used one header template.
        created text editor for each text.
    is there any problem with header template.if nt,after created header template,wat ll i do,it ll b assign to  anywhere.
    giv me reply asap.
    reagrds,
    satya
    points ll b rewarded.

    Hi,
    Sorry if I've not understood your question, but all this 'wht', 'nt', 'plz' stuff is a bit difficult to follow.
    Anyway, you've got a window, in this you've defined a template, then some text elements with variables?  Have you assigned the text elements to cells of the templates by putting values in the output tab?  If not the text will not appear.
    Regards,
    Nick

  • File upload component and text area issue

    Hi guys,
    I have static text, text area and button on the same page. Text area binded to session bean value and all works fine (I can input text into text area and press button to save changes).
    After adding file upload component to the same page I have got a problem - now after page refreshing the non english characters inside text gets trashed.
    Other non english characters - inside static text components remains the same - the problem relates only to text area.
    It looks like file upload component code has an encoding related bug. Is that a known issue?
    And may be somebody have a workaround?
    Thanks.

    Hi Rom@n,
    I did some checking and this issue is currently logged as: 6442528. It is scheduled to be available in the next patch release. I'm sorry I don't have a time frame for the patch since it is still waiting for other fixes.
    Sorry for the inconvience.
    Lark
    Creator Team

  • Hi there. I having a problem with InDesign PDF interactive export. I would keep my text area style and not text area default style when I export the PDF. How could I do?

    Could you help me?

    Thanks for the answer Sumit Singh,
    sorry but my problem keeps.
    I create a simple text area and then trasform it in interactive text area, set it, apply my paragraph/character style and at the end export it in PDF (interactive).
    I open the file with Adobe Acrobat, but when I customize it, words inside text area have stylized with default paragraph/character style.
    How could I keep my style on export interactive text area?
    Thanks a lot.

  • How do you add an image in the text area of a page/section?

    This has been driving me nuts!
    When I try to add an image to a page, it will ONLY go into the header.  If I try to drag the image onto the page where the text is, it gets hidden behind a layer.
    I've looked at the menu choices and I don't seem to be allowed to bring the image to the front.  Nor does clicking in the text area and then trying to paste or insert the image - it still goes up in the header.
    What is the secret to placing images along with your text on a page in the iBooks Author program?
    Thanks!

    Wow, Apple has really constrained the "box" that we have to fit our books into!
    I was hoping to take some iPad screenshots and put them inline with the text.  Since they are portrait iPad screenshots, the book that I'd like to create looks much better (and makes more sense) in portrait mode.
    Apple has released this awesome tool, yet they seem to have restricted the author from using any creativity at all.

  • Why Can't I get my total to output to the text area?

    I can get the numbers to go to the text area and to clear the text area but, the only way I have figured out how to output the total is with a JOptionPane. Can someone look at my code and tell me how to fix this?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Calculator4 extends JApplet implements ActionListener
    String Nums="";
    String sNum="";
    double Num1=0;
    double Num2=0;
    double Add=0;
    double Subtract=0;
    double Multiply=0;
    double Divide=0;
    int choice=0;
    private JTextField displayField;
    private JButton Button0, Button1, Button2, Button3, Button4, Button5,
    Button6, Button7, Button8, Button9, ButtonAdd, ButtonSub,
    ButtonMult, ButtonDiv, ButtonClear, Buttontotal;
    public void init()
    Container container = getContentPane();
    container.setLayout(new FlowLayout());
    displayField = new JTextField(15);
    displayField.setEditable(false);
    container.add(displayField);
    Button1 = new JButton("1");
    Button1.addActionListener(this);
    container.add(Button1);
    Button2 = new JButton("2");
    Button2.addActionListener(this);
    container.add(Button2);
    Button3 = new JButton("3");
    Button3.addActionListener(this);
    container.add(Button3);
    ButtonAdd = new JButton("+");
    ButtonAdd.addActionListener(this);
    container.add(ButtonAdd);
    Button4 = new JButton("4");
    Button4.addActionListener(this);
    container.add(Button4);
    Button5 = new JButton("5");
    Button5.addActionListener(this);
    container.add(Button5);
    Button6 = new JButton("6");
    Button6.addActionListener(this);
    container.add(Button6);
    ButtonSub = new JButton("-");
    ButtonSub.addActionListener(this);
    container.add(ButtonSub);
    Button7 = new JButton("7");
    Button7.addActionListener(this);
    container.add(Button7);
    Button8 = new JButton("8");
    Button8.addActionListener(this);
    container.add(Button8);
    Button9 = new JButton("9");
    Button9.addActionListener(this);
    container.add(Button9);
    ButtonMult = new JButton("*");
    ButtonMult.addActionListener(this);
    container.add(ButtonMult);
    Button0 = new JButton("0");
    Button0.addActionListener(this);
    container.add(Button0);
    ButtonDiv = new JButton("/");
    ButtonDiv.addActionListener(this);
    container.add(ButtonDiv);
    ButtonClear = new JButton(" Clear ");
    ButtonClear.addActionListener(this);
    container.add(ButtonClear);
    Buttontotal = new JButton("=");
    Buttontotal.addActionListener(this);
    container.add(Buttontotal);
    public void actionPerformed(ActionEvent actionEvent)
    if(actionEvent.getSource() == Button1)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("1");}
    if(Nums!=null)
    {  Nums= Nums + 1;
    updateDisplay();}
    else if(actionEvent.getSource()==Button2)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("2");}
    if(Nums!=null)
    {  Nums= Nums + 2;
    updateDisplay();}
    else if(actionEvent.getSource()==Button3)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("3");}
    if(Nums!=null)
    {  Nums= Nums + 3;
    updateDisplay();}
    else if(actionEvent.getSource()==Button4)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("4");}
    if(Nums!=null)
    {  Nums= Nums + 4;
    updateDisplay();}
    else if(actionEvent.getSource()==Button5)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("5");}
    if(Nums!=null)
    {  Nums= Nums + 5;
    updateDisplay();}
    else if(actionEvent.getSource()==Button6)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("6");}
    if(Nums!=null)
    {  Nums= Nums + 6;
    updateDisplay();}
    else if(actionEvent.getSource()==Button7)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("7");}
    if(Nums!=null)
    {  Nums= Nums + 7;
    updateDisplay();}
    else if(actionEvent.getSource()==Button8)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("8");}
    if(Nums!=null)
    {  Nums= Nums + 8;
    updateDisplay();}
    else if(actionEvent.getSource()==Button9)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("9");}
    if(Nums!=null)
    {  Nums= Nums +9;
    updateDisplay();}
    else if(actionEvent.getSource()==Button0)
    play(getCodeBase(),"Ping.WAV");
    if(Nums==null)
    {  Nums= "";
    displayField.setText("0");}
    if(Nums!=null)
    {  Nums= Nums + 0;
    updateDisplay();}
    else if(actionEvent.getSource()==ButtonAdd)
    play(getCodeBase(),"Ping.WAV");
    choice = 1;
    sNum="";
    sNum = Nums;
    Nums=null;
    else if(actionEvent.getSource()==ButtonSub)
    play(getCodeBase(),"Ping.WAV");
    choice = 2;
    sNum="";
    sNum = Nums;
    Nums=null;
    else if(actionEvent.getSource()==ButtonMult)
    play(getCodeBase(),"Ping.WAV");
    choice = 3;
    sNum="";
    sNum = Nums;
    Nums=null;
    else if(actionEvent.getSource()==ButtonDiv)
    play(getCodeBase(),"Ping.WAV");
    choice = 4;
    sNum="";
    sNum = Nums;
    Nums=null;
    else if(actionEvent.getSource()==Buttontotal)
    play(getCodeBase(),"Ping.WAV");
    if(choice==0)
    JOptionPane.showMessageDialog(null,"Please Select Operation");
    if(choice!=0)
    switch(choice)
    case 1:
    if(Nums!=null)
    {    Num1 = Double.parseDouble(sNum);
    Num2 = Double.parseDouble(Nums);
    double Add = Addition(Num1, Num2);
    JOptionPane.showMessageDialog(null,"Your Sum is: " + Add);
    sNum = "";
    if(Nums==null)
    JOptionPane.showMessageDialog(null,"Please Enter Second number");
    Nums=null;
    break;
    case 2:
    if(Nums!=null)
    {    Num1 = Double.parseDouble(sNum);
    Num2= Double.parseDouble(Nums);
    double Subtract = Subtraction(Num1, Num2);
    JOptionPane.showMessageDialog(null,"Your Difference is: " + Subtract);
    sNum = "";
    if(Nums==null)
    JOptionPane.showMessageDialog(null,"Please Enter Second number");
    Nums=null;
    break;
    case 3:
    if(Nums!=null)
    {    Num1= Double.parseDouble(sNum);
    Num2= Double.parseDouble(Nums);
    double Multiply = Multiplication(Num1, Num2);
    JOptionPane.showMessageDialog(null,"Your Product is: " + Multiply);
    sNum = "";
    if(Nums==null)
    JOptionPane.showMessageDialog(null,"Please Enter Second number");
    Nums=null;
    break;
    case 4:
    if(Nums!=null)
    {    Num1 = Double.parseDouble(sNum);
    Num2= Double.parseDouble(Nums);
    double Divide = Division(Num1, Num2);
    JOptionPane.showMessageDialog(null,"Your Quotient is: " + Divide);
    sNum = "";
    if(Nums==null)
    JOptionPane.showMessageDialog(null,"Please Enter Second number");
    Nums=null;
    break;
    else if(actionEvent.getSource()==ButtonClear)
    play(getCodeBase(),"Ping.WAV");
    displayField.setText("");
    Nums=null;
    sNum="";
    choice=0;
    Num1=0;
    Num2=0;
    public void updateDisplay()
    displayField.setText(Nums);
    public double Addition(double Num1, double Num2)
    return ( Num1 + Num2);
    public double Subtraction(double Num1, double Num2)
    return ( Num1 - Num2);
    public double Multiplication(double Num1, double Num2)
    return ( Num1 * Num2);
    public double Division(double Num1, double Num2)
    return ( Num1 / Num2);
    }

    You mean something like this:
    private int currentNumber =0;
    private int total = 0;
    private JTextField Display = new JTextField(10);
    private JtextField Current = new JTextField(10);
    // Add all your buttons correctly
    // Try using a GridLayout to make it easier
    // blah blah
    public void actionPerformed( ActionEvent event )
    int number = -1;
    String Command = event.getActionCommand();
    // Play your sound here.....
      doPlaySound();
    try
       number = Integer.parseInt( command );
    catch( NumberFormatException NFE )
        //ignore
    if( number != -1 )
        doIsNumber( number );
        return;   // don't process further
    if( command == "Enter" )
        doEnter();
        return;
    if(command == "Plus" )
        doPlus();
        return;
    // and so on
    }//end actionPerformed
    private void doNumber( int number )
       String S;
        currentNumber = ( currentNumber * 10 ) + number;
        S = Integer.tostring( currentNumber );  //cant remember if that throws anything
       Current.setText( S );  //Display Work Number
      private void doPlus()
        String S;
        total = total + currentNumber;
        currentNumber = 0;
        Current.setText("");
        S = Integer.toString( total );
        Display.setText( S );
      private void doEnter()
        total = currentNumber;
        currentNumber = 0;
        Current.setText( "");
        Display.setText( Integer.toString( total ) );
      private void doDivide()
         System.out.println("Err you got to be kidding");
      }yeh and I'd definitely go for a GridLayout()
    4 * 4, with JLabels for the blank filler parts......
    So does this help

  • How to get the long text into text area

    Hi,
    save_text is working fine .
    Now I want to display the text in text area .
    am using read_text fm for this and data is coming into the internal table of the function module.
    how shd I display that long text into text area and that text shld appear has display mode only and how shd I make all other fields in my subscreen as display mode.
    Pls guide me its urgent.
    thanks,
    krishna

    Hai.
    check this.
    Long Texts are stored in tables
    STXH - header
    STXL - details.
    if you want to read the texts you can use Fun Module  READ_TEXT
    Any Application document Header and Item Long texts are stored in STXH table with the 4 parameters OBJECT,ID,NAME and LANG
    These texts are fetched from database using READ_TEXT fun module by passing the above 4 parameters.
    Double click on the text, from the text editor menu GOTO-> HEDAER
    you will find the all above 4 parameters
    so accordingly you have to pass to the fun module READ_TEXT to fetch the texts.
    example:
    Re: upload longtext from excel file  
    REPORT  zupload_excel_to_itab.
    TYPE-POOLS: truxs.
    PARAMETERS: p_file TYPE  rlgrap-filename.
    TYPES: BEGIN OF t_datatab,
          col1(30)    TYPE c,
          col2(30)    TYPE c,
          col3(30)    TYPE c,
          END OF t_datatab.
    DATA: it_datatab type standard table of t_datatab,
          wa_datatab type t_datatab.
    DATA: it_raw TYPE truxs_t_text_data.
    At selection screen
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    *START-OF-SELECTION.
    START-OF-SELECTION.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
        I_FIELD_SEPERATOR        =
          i_line_header            =  'X'
          i_tab_raw_data           =  it_raw       " WORK TABLE
          i_filename               =  p_file
        TABLES
          i_tab_converted_data     = it_datatab[]    "ACTUAL DATA
       EXCEPTIONS
          conversion_failed        = 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.
    END-OF-SELECTION.
    END-OF-SELECTION.
      LOOP AT it_datatab INTO wa_datatab.
        WRITE:/ wa_datatab-col1,
                wa_datatab-col2,
                wa_datatab-col3.
      ENDLOOP.
    refards.
    sowjanya.b

  • Access of the Text in the TextField

    In the following code ,how can I access text in the textfield(i.e object x in the following code) in the place of z in the following code:
    BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(z)));
    import java.awt.Color;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.JTextArea;
    public class TextAreaTest1
    public static void main(String[] args)
    TextAreaFrame frame = new TextAreaFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    A frame with a text area and buttons for text editing
    class TextAreaFrame extends JFrame implements ActionListener
    public String TextAreaFrame()
    setTitle("TextAreaTest");
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
    Container contentPane=getContentPane();
    contentPane.setLayout(new GridLayout(5,5,0,0));
    buttonPanel = new JPanel();
    JPanel textField=new JPanel();
    buttonPanel.add(new JLabel("enter"));
    // add button to append text into the text area
    JTextField x=new JTextField(20);
    JButton insertButton = new JButton("Insert");
    textField.add(new JLabel("Enter the path"));
    // textArea = new JTextArea(8, 30);
    // contentPane.add(insertButton);
    buttonPanel.add(insertButton);
    textField.add(x);
    String z=x.getText();
    insertButton.addActionListener(this);
    contentPane.add(textField);
    JPanel group=new JPanel();
              final JTextField a=new JTextField(18);
              JRadioButton b1=new JRadioButton("Start");
              group.add(b1);
              group.add(new JLabel("to"));
              group.add(a);
              JRadioButton b2=new JRadioButton("End");
              group.add(new JLabel("to"));
              group.add(b2,new JLabel("to"));
    add(group, BorderLayout.SOUTH);
    contentPane.add(buttonPanel);
    textArea = new JTextArea(8, 30);
    scrollPane = new JScrollPane(textArea);
    add(scrollPane);
    return(z);
    public String getField(){ return x.getTest();}
    public void actionPerformed(ActionEvent event)
         try
         BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(z)));
         String l;
                                  // String text = a.getText();
    System.out.println(+textArea.getLineCount());
         while((l=br.readLine())!=null)
    if(l.indexOf("error")==-1)
    textArea.append(l+"\n");
    textArea.setFont(new Font("Dialog", Font.BOLD, 12));
    textArea.setForeground(Color.blue);
    System.out.println("this");
    /*StringTokenizer st=new StringTokenizer(l);
         //String a="error";
    String[] b=new String[10];
         while(st.hasMoreTokens())
                                                           //if(!st.equals("error"))
    int i=0;
                                  String key=st.nextToken();
                                                           b=key;
                                                           {if(b[i].equals("error"))
                                                           textArea.setFont(new Font("Dialog", Font.BOLD, 12));
                                                           textArea.append(b[i]+"\n");
    System.out.println("this");
                                                           i++;}
                                                           else
                                                                     textArea.setFont(new Font("Serif", Font.PLAIN, 12));
                                                                     textArea.append(b[i]+"\n");
    System.out.println("that");
                                                           i++;
                                                           //if(!key.equals("error"))
    //textArea.append(key+"\n");
                                                           //String val=st.nextToken();
                                                           //textArea.setFont(new Font("Dialog", Font.BOLD, 12));
                                                           //textArea.append(ky+"\n");
                                                           //Font f=new Font("Serif",Font.BOLD,40);
                             //textArea.setColor(new JColorChooser());
         //textArea.append(val+"\n");
                                            if(l.indexOf("error")!=-1)
                                                 textArea.setFont(new Font("Serif", Font.PLAIN, 12));
                                                 //textArea.setColor(Color.black);
                                                 textArea.setForeground(Color.red);
                                                 textArea.append(l);
                                       System.out.println("that");
                        catch(Exception ex)
    public static final int DEFAULT_WIDTH = 400;
    public static final int DEFAULT_HEIGHT = 400;
    private JTextArea textArea;
    private JScrollPane scrollPane;
    private JPanel buttonPanel;
    private JButton wrapButton;

    1) Swing related questions should be posted in the Swing forum.
    2) Don't forget to use the "Code Formatting Tags",
    see http://forum.java.sun.com/help.jspa?sec=formatting,
    so the posted code retains its original formatting.
    3) Use a more descriptive variable name. "x" means nothing.
    4) Define the text field reference name as a class variable, not a local variable.

  • Possible to highlight a row in text area which in turn would fire an event?

    I'm making a GUI of which the main portion consists of a large text area. The text area would list problems that our company is experiencing - each row would represent a problem. Each row would give a problem ID and a description of the problem. I want to make it so that when the user clicks on a row (a problem), another dialog box would open which would present possible solutions to the user regarding the problem at hand. How would I write code to highlight a row which in turn would fire an event opening up another box?
    I thought about going about this another way - have a drop down (jcombobox) integrated into each row which the user can choose from but I'm not sure if you can insert a drop down into a text area (and neatly into a row at that!) so I think the former way may be preferable.
    Thanks in advance.
    Regards,
    Paul

    If a java application is required (as opposed to a web-based solution using HTML's linking capabilities) the best approach might be a JList implementation. It could go something like this...
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class ListFrame extends JFrame
       public ListFrame()
          super("JList example frame");
          getContentPane().add(getListPanel(), BorderLayout.CENTER);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          pack();
          setVisible(true);
       private Component getListPanel()
          JPanel panel = new JPanel(new BorderLayout());
          final JList list = new JList(new Object[]
             "List option 1...",
             "List option 2...",
             "List option 3..."
          // This will make sure only one item can be checked at a time.
          list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
          // Handle the selection here.
          list.addListSelectionListener(new ListSelectionListener()
             public void valueChanged(ListSelectionEvent e)
                // No need to go on if this was a deselection.
                if (e.getValueIsAdjusting() || list.isSelectionEmpty())
                   return;
                // This is where you would have to convert the value that's selected into whatever
                // it is you want to display to the user.  This example just puts the text of the
                // selected item into a messagebox.
                Object selectedItem = list.getSelectedValue();
                JOptionPane.showMessageDialog(ListFrame.this, selectedItem);
          list.setVisibleRowCount(5);
          // The scrollpane will control the scrolling of the list (so you can have as many options
          // as you want).  Standard JScrollPane functionalities can be used to control various
          // visual aspects of the list.     
          JScrollPane scroll = new JScrollPane(list);
          scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
          panel.add(scroll, BorderLayout.CENTER);
          return panel;
       public static void main(String[] args)
          new ListFrame();
    }I know this is quite after-the-fact, but I hope it helps (if you hadn't already solved the problem :) )

Maybe you are looking for

  • Data not populated when run from a different machine

    I have a stored procedure which populates a table The stored procedure when it is run on my machine using SQL Plus populates data correctly in a table. I select using SQL PLUS and it shows that the data is there But when I run the SAME procedure ( SA

  • Time Capsule problems with the xbox 360

    Im not going to type this all out again so i'll give you guys the link to my unanswered post on mac rumors. http://forums.macrumors.com/showthread.php?t=448296 Can anyone help?

  • My ipod has doubled up my music

    My iPod touch 5th generation has doubled up my itunes library. I normally have around 900 songs and about 800 of them have doubled up. If I try to un-sync the music off my ipod it leave about 600 songs on there and they won't go away. Do I delete the

  • In-house Repair with ERP billing

    Hello, I'm trying to create a process beginning with a repair order in CRM and ending with billing in ERP. This is the process as I envision it: 1) Create repair order. 2) Create return request item in repair order. 3) Create inbound delivery, then g

  • How do you uninstall Tiger?

    For troubleshooting a problem, I installed Tiger on a second internal drive. Now that the problem is solved I would like to remove all traces of Tiger from that drive. Is there a correct way to do this? Simply dragging everything to the trash only wo