JTextArea - setLineWrap(true) = no text

Hi,
Cross-posted to comp.lang.java.gui...
I have a JTextArea that is running over a JPanel with an image in it.
Here's the code:
Image image = Toolkit.getDefaultToolkit().getImage("images/homer02.jpg");
ImagePanel quotesPanel = new ImagePanel(image);
quotesTextArea = new JTextArea(getNextQuote());
quotesTextArea.setLineWrap(true);
quotesTextArea.setWrapStyleWord(true);
quotesTextArea.setOpaque(false);
quotesPanel.add(quotesTextArea);
When I try to use setLineWrap(true), the text won't display,
but when that method is commented out, the text is displayed
but centered and all on one line, falling off each end.
Is there something I'm not doing? The code matches that in the TextComponent
demo in the Swing tutorial, although they use a JFrame while this is all part of a
JWindow that shows quotes from the ancient Greeks over an image of the poet
Homer, (not Mr. Simpson). ImagePanel is an extension of JPanel that has an
image as a background. getNextQuote() returns a quote from a text file.
Thank you in advance,
Edward

hello Andy
iam using the same and the text is visible. i.e textArea.setLineWrap( true );
asrar

Similar Messages

  • JTextArea: size dynamic with text

    I''m trying to size a JTextArea according to the text that is occupy it.
    The width I have from another JPanel, but the height I can't get right.
    I need to get the number of lines that the text will occupy and then set the size accordingly.
    As it is, I've hard-coded the number of lines, even so, that doesn't work. e.g. if i set # of lines = 5, it still shows only 2, though the dlg box can be resized by hand to show them all.
    Any suggestions?
    public class TextPanel extends JPanel {
        private final Insets insets =  new Insets(10,20,10,20); // top, left, bottom, right
        private JTextArea textArea;
        private FontMetrics metrics;
        private double widthButtonPanel;
         * @param message
         * @param dimension dimensions of button panel
        public TextPanel(String message, Dimension dimension) {
          // get bg color of panel so we can set bg of text area to same color
             Color color = getBackground();
           TextArea = new JTextArea (message);
         textArea.setLineWrap(true);
         textArea.setWrapStyleWord(true);
         textArea.setBackground(color);
           TextArea.setMargin(insets);
         // this will be width of the text area
         // height can't be set until painting it because we need to get the text size
           widthButtonPanel = dimension.getWidth();
         add(textArea);
         * override default insets
        public Insets getInsets()
             return insets;
        @Override
         * override in order to set height of text area
         * @param g Graphics
        public void paintComponent(Graphics g)
             // automatically called when repaint
             super.paintComponent(g);
         Font font = this.getFont();
             Graphics graphics = this.getGraphics();
             // get metrics from the graphics
             metrics = graphics.getFontMetrics(font);
         // get the height of a line of text in this font and render context
           // line height must be that of text only, not space above and below
             final int HEIGHT_SPACE = 7; // empirically derived
         int heightTextAreaLine = metrics.getHeight() + HEIGHT_SPACE;
         // set height
         final int numberOfLines = 5;
            // truncate double, doesn't matter because it is *.0 anyway
         Dimension newDimension = new Dimension((int)widthButtonPanel, heightTextAreaLine * numberOfLines);
            TextArea.setPreferredSize(newDimension);
            //textArea.setMaximumSize(newDimension);
            TextArea.setMinimumSize(newDimension);
    }Edited by: allelopath on Jan 19, 2009 2:33 PM

    You can get the size following the steps.
    1. create dummy textarea and set your text to it.
    2. dummyarea.setSize(new Dimension(desiredWidth, Short.MAX_VALUE));
    3. Dimension pref=dummyarea.getPreferredSize();
    pref.height is the height textarea need to be.
    Regards,
    Stas

  • How to change color of font in JTextArea without changing existing text ?

    Is there some way to keep the existing text in one color / size and change the color / size
    of the yet "unwritten" part of text ?
    Edited by: pimpcane on Dec 11, 2007 9:53 AM

    The very first paragraph of the API documentation says
    "A JTextArea is a multi-line area that displays plain text. It is intended to be a lightweight component that provides source compatibility with the java.awt.TextArea class where it can reasonably do so. You can find information and examples of using all the text components in Using Text Components, a section in The Java Tutorial."
    In other words, if it isn't obvious from that, no. The actual link to the tutorial doesn't show up here but if you go to the API documentation you'll find it there.

  • PropertyDescriptor.isBound() returns "true" for text-property of JTextField

    Hello,
    I have this simple code to retrieve all bound properties of a JTextField:
    BeanInfo beanInfo = Introspector.getBeanInfo( JTextField.class );
    PropertyDescriptor[] discriptors = beanInfo.getPropertyDescriptors();
    for ( PropertyDescriptor propertyDescriptor : discriptors ) {
         System.out.println( "propertyDescriptor.getDisplayName(): " + propertyDescriptor.getDisplayName() );
         System.out.println( "propertyDescriptor.isBound(): " + propertyDescriptor.isBound() );
         System.out.println();
    }When I run this, I can see that the property "text" is listet as "bound" (isBound() == true ). I know there is no JTextFieldBeanInfo, so the Introspector does a runtime introspection. And I know that "text" is not a bound property on JTextField. So why is "isBound()" reporting "true" for the "text" property? (I was hoping to get all bound properties of a class this way, but appearently it does not word).
    Thanks a lot for your help!

    Hello,
    so far I was not able to solve the problem... regarding my question my isBound() is true for the "text" Property, does anyone know why? And furthermore, how could one gather all bound properties of a swing component?

  • .embedFonts = true  causing text to disappear?

    Why would this happen?
    I've added Helvetica to my Library.  I've set it to export for Actionscript.  I've given it the name 'Helvetica'.  I'm setting the defaultTextFormat.  Then I tell it to embedFonts, and the bloody textfield doesn't show up.
    var tf:TextField = new TextField();
         tf.defaultTextFormat = new TextFormat('Helvetica Neue', 13, 0xFFFFFF);
         tf.embedFonts = true;

    Wierd, up until recently this was working on the same project, which has always been AS3. But you're right, instantiating the font, and passing the font's fontName variable worked.  Thanks kglad.

  • Problem sizing a JTextArea

    I'm trying to write a class with a button which, when clicked, will alternate between two panels.
    My problem is the entire "details" message will not display.
    I've tried various combinations of layout managers with calls to setSize() and setRows(), or using a JTextPane instead.
    My brain feels like a bowl of spaghetti because I'm not getting anywhere.
    What am I missing?
    Thanx to one and all.import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import  javax.swing.border.*;
    public class ToggleButton extends JFrame implements ActionListener
       private JButton button;
       private JPanel panel , detailPanel;
       private Container contentPane = getContentPane();
       public ToggleButton()
          setLayout(new GridLayout(2,1));
          setBounds(400 , 250 , 200 , 100);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          button = new JButton("Show Details");
          button.addActionListener(this);
          panel = new JPanel();
          panel.add(button);
          JTextArea details = new JTextArea();
          TitledBorder  border = BorderFactory.createTitledBorder("Details");
          details.setBorder(border);
          details.setLineWrap(true);
          String text = "Now is the time for all good women to come to the aid of their men.";
          details.setText(text);
          detailPanel = new JPanel();
          detailPanel.add(details);
          contentPane.add(panel);
          setVisible(true);
       public void actionPerformed(ActionEvent ae)
          if (ae.getActionCommand().equals("Show Details"))
             button.setText("Hide Details");
             setBounds(400 , 250 , 200 , 200);
             contentPane.add(detailPanel);
          else
             button.setText("Show Details");
             contentPane.remove(detailPanel);
             setBounds(400 , 250 , 200 , 100);
       public static void main(String[] args)
          new ToggleButton();
    }

       public void actionPerformed(ActionEvent ae)
          if (ae.getActionCommand().equals("Show Details"))
             button.setText("Hide Details");
             setBounds(400 , 250 , 200 , 200);
             contentPane.add(detailPanel);
          else
             button.setText("Show Details");
             contentPane.remove(detailPanel);
             setBounds(400 , 250 , 200 , 100);
          validate();
       }The Grid layout will cause problems, but I am sure you can figure that out.
    FYI: It might be better practice to toggle the details panel's visibility rather than adding and removing it. Just a thought.

  • Help needed with passing data between classes, graph building application?

    Good afternoon please could you help me with a problem with my application, my head is starting to hurt?
    I have run into some difficulties when trying to build an application that generates a linegraph?
    Firstly i have a gui that the client will enter the data into a text area call jta; this data is tokenised and placed into a format the application can use, and past to a seperate class that draws the graph?
    I think the problem lies with the way i am trying to put the data into co-ordinate form (x,y) as no line is being generated.
    The following code is from the GUI:
    +public void actionPerformed(ActionEvent e) {+
    +// Takes data and provides program with CoOrdinates+
    int[][]data = createData();
    +// Set the data data to graph for display+
    grph.showGrph(data);
    +// Show the frame+
    grphFrame.setVisible(true);
    +}+
    +/** set the data given to the application */+
    +private int[][] createData() {+
    +     //return data;+
    +     String rawData = jta.getText();+
    +     StringTokenizer tokens = new StringTokenizer(rawData);+
    +     List list = new LinkedList();+
    +     while (tokens.hasMoreElements()){+
    +          String number = "";+
    +          String token = tokens.nextToken();+
    +          for (int i=0; i<token.length(); i++){+
    +               if (Character.isDigit(token.charAt(i))){+
    +                    number += token.substring(i, i+1);+
    +               }+
    +          }     +
    +     }+
    +     int [][]data = new int[list.size()/2][2];+
    +     int index = -2;+
    +     for (int i=0; i<data.length;i++){+
    +               index += 2;+
    +               data[0] = Integer.parseInt(+
    +                         (list.get(index).toString()));+
    +               data[i][1] = Integer.parseInt(+
    +                         (list.get(index +1).toString()));+
    +          }+
    +     return data;+
    The follwing is the coding for drawing the graph?
    +public void showGrph(int[][] data)  {+
    this.data = data;
    repaint();
    +}     +
    +/** Paint the graph */+
    +protected void paintComponent(Graphics g) {+
    +//if (data == null)+
    +     //return; // No display if data is null+
    super.paintComponent(g);
    +// x is the start position for the first point+
    int x = 30;
    int y = 30;
    for (int i = 0; i < data.length; i+) {+
    +g.drawLine(data[i][0],data[i][1],data[i+1][0],data[i+1][1]);+
    +}+
    +}+

    Thanks for that tip!
    package LineGraph;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.util.List;
    public class GUI extends JFrame
      implements ActionListener {
      private JTextArea Filejta;
      private JTextArea jta;
      private JButton jbtShowGrph = new JButton("Show Chromatogram");
      public JButton jbtExit = new JButton("Exit");
      public JButton jbtGetFile = new JButton("Search File");
      private Grph grph = new Grph();
      private JFrame grphFrame = new JFrame();   // Create a new frame to hold the Graph panel
      public GUI() {
         JScrollPane pane = new JScrollPane(Filejta = new JTextArea("Default file location: - "));
         pane.setPreferredSize(new Dimension(350, 20));
         Filejta.setWrapStyleWord(true);
         Filejta.setLineWrap(true);     
        // Store text area in a scroll pane 
        JScrollPane scrollPane = new JScrollPane(jta = new JTextArea("\n\n Type in file location and name and press 'Search File' button: - "
                  + "\n\n\n Data contained in the file will be diplayed in this Scrollpane "));
        scrollPane.setPreferredSize(new Dimension(425, 300));
        jta.setWrapStyleWord(true);
        jta.setLineWrap(true);
        // Place scroll pane and button in the frame
        JPanel jpButtons = new JPanel();
        jpButtons.setLayout(new FlowLayout());
        jpButtons.add(jbtShowGrph);
        jpButtons.add(jbtExit);
        JPanel searchFile = new JPanel();
        searchFile.setLayout(new FlowLayout());
        searchFile.add(pane);
        searchFile.add(jbtGetFile);
        add (searchFile, BorderLayout.NORTH);
        add(scrollPane, BorderLayout.CENTER);
        add(jpButtons, BorderLayout.SOUTH);
        // Exit Program
        jbtExit.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e) {
             System.exit(0);
        // Read Files data contents
         jbtGetFile.addActionListener(new ActionListener(){
         public void actionPerformed( ActionEvent e) {
                   String FileLoc = Filejta.getText();
                   LocateFile clientsFile;
                   clientsFile = new LocateFile(FileLoc);
                        if (FileLoc != null){
                             String filePath = clientsFile.getFilePath();
                             String filename = clientsFile.getFilename();
                             String DocumentType = clientsFile.getDocumentType();
         public String getFilecontents(){
              String fileString = "\t\tThe file contains the following data:";
         return fileString;
           // Register listener     // Create a new frame to hold the Graph panel
        jbtShowGrph.addActionListener(this);
        grphFrame.add(grph);
        grphFrame.pack();
        grphFrame.setTitle("Chromatogram showing data contained in file \\filename");
      /** Handle the button action */
      public void actionPerformed(ActionEvent e) {
        // Takes data and provides program with CoOrdinates
        int[][]data = createData();
        // Set the data data to graph for display
        grph.showGrph(data);
        // Show the frame
        grphFrame.setVisible(true);
      /** set the data given to the application */
      private int[][] createData() {
           String rawData = jta.getText();
           StringTokenizer tokens = new StringTokenizer(rawData);
           List list = new LinkedList();
           while (tokens.hasMoreElements()){
                String number = "";
                String token = tokens.nextToken();
                for (int i=0; i<token.length(); i++){
                     if (Character.isDigit(token.charAt(i))){
                          number += token.substring(i, i+1);
           int [][]data = new int[list.size()/2][2];
           int index = -2;
           for (int i=0; i<data.length;i++){
                     index += 2;
                     data[0] = Integer.parseInt(
                             (list.get(index).toString()));
                   data[i][1] = Integer.parseInt(
                             (list.get(index +1).toString()));
         return data;
    public static void main(String[] args) {
    GUI frame = new GUI();
    frame.setLocationRelativeTo(null); // Center the frame
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setTitle("Clients Data Retrival GUI");
    frame.pack();
    frame.setVisible(true);
    package LineGraph;
    import javax.swing.*;
    import java.awt.*;
    public class Grph extends JPanel {
         private int[][] data;
    /** Set the data and display Graph */
    public void showGrph(int[][] data) {
    this.data = data;
    repaint();
    /** Paint the graph */
    protected void paintComponent(Graphics g) {
    //if (data == null)
         //return; // No display if data is null
    super.paintComponent(g);
    //Find the panel size and bar width and interval dynamically
    int width = getWidth();
    int height = getHeight();
    //int intervalw = (width - 40) / data.length;
    //int intervalh = (height - 20) / data.length;
    //int individualWidth = (int)(((width - 40) / 24) * 0.60);
    ////int individualHeight = (int)(((height - 40) / 24) * 0.60);
    // Find the maximum data. The maximum data
    //int maxdata = 0;
    //for (int i = 0; i < data.length; i++) {
    //if (maxdata < data[i][0])
    //maxdata = data[i][1];
    // x is the start position for the first point
    int x = 30;
    int y = 30;
    //draw a vertical axis
    g.drawLine(20, height - 45, 20, (height)* -1);
    // Draw a horizontal base line4
    g.drawLine(20, height - 45, width - 20, height - 45);
    for (int i = 0; i < data.length; i++) {
    //int Value = i;      
    // Display a line
    //g.drawLine(x, height - 45 - Value, individualWidth, height - 45);
    g.drawLine(data[i][0],data[i][1],data[i+1][0],data[i+1][1]);
    // Display a number under the x axis
    g.drawString((int)(0 + i) + "", (x), height - 30);
    // Display a number beside the y axis
    g.drawString((int)(0 + i) + "", width - 1277, (y) + 900);
    // Move x for displaying the next character
    //x += (intervalw);
    //y -= (intervalh);
    /** Override getPreferredSize */
    public Dimension getPreferredSize() {
    return new Dimension(1200, 900);

  • Install Application - TextArea inside JScrollPane

    I've been working on an install application to install another one of my programs (next/accept/next/ finish type of thing) and had a couple questions and would appreciate any help anyone can give.
    Some Background info:
    I made images and have them display as image icons through jlabels for the buttons and background. The labels have classes applying various mouselisteners (Mousepressed, MouseEntered, MouseExited, etc) changing the images and moving from screen to screen. I have my layout set to null, not for any particular reason, but because I have no formal education in layout managers.
    1) Is there a conical solution to moving through various windows? That is, right now I move through the various 'screens' with a check on an int called state, that gets incremented and decremented through forward and back buttons. I looked at some code given to us on a test by our teacher (we had to find bugs) and saw that he had implemented a fake "state" interface, with constants like "Account_State" to control where you were in the program. This seems a bit easier to read than ints, but is there a correct built in version of his states?
    2) On the second screen I have a license agreement (actually required for the application that gets installed), and a checkbox. The license is held inside of a JTextArea(scroll) inside a JScrollPane(textscroll). The JScrollPane is extending in weird ways. The following is a stripped down version of my code (it runs and demonstrates the problem):
    InstalleApp
    import javax.swing.*;
    import java.awt.*;
    public class InstalleApp {
        public static void main(String args[]) {
            InstalleFrame m = new InstalleFrame();
               Container content = m.getContentPane();
            m.setDefaultCloseOperation(3);
            m.setSize(550, 400);
            m.setUndecorated(true);
            m.setVisible(true);
            m.setTitle("Install");
    }InstalleFrame
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.JFrame;
    import java.awt.event.*;
    import java.awt.Rectangle;
    import java.awt.Font;
    import java.awt.BorderLayout;
    import java.util.*;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    import java.awt.event.ActionEvent;
    import javax.swing.text.BadLocationException;
    import javax.swing.JSlider;
    import java.awt.Dimension;
    public class InstalleFrame
        extends JFrame implements ActionListener {
      public InstalleFrame() {
        try {
          jbInit();
        catch (Exception ex) {
          ex.printStackTrace();
      public void actionPerformed(ActionEvent e) {
      JScrollPane textscroll;
      private void jbInit() throws Exception {
        this.getContentPane().setLayout(null);
        this.getContentPane().setBackground(UIManager.getColor("window"));
        background.setBounds(new Rectangle(0, 0, 550, 400));
        readcheck.setOpaque(false);
        readcheck.setText("I have read and accept the license agreement");
        readcheck.setBounds(new Rectangle(31, 357, 319, 32));
        scroll.setWrapStyleWord(true);
        scroll.setLineWrap(true);
        scroll.setText(
            "Copyright ? 2006-2007 GonZor228.com \n\nBy using or distributing this " +
            "software (or any work based on the software) you shall be deemed " +
            "to have accepted the terms and conditions set out below.\n\nGonZor228.com " +
            "(\"GonZor\") is making this software freely available on the basis " +
            "that it is accepted as found and that the user checks its fitness " +
            "for purpose prior to use.\n\nThis software is provided \'as-is\', without " +
            "any express or implied warranties whatsoever. In no event will the " +
            "authors, partners or contributors be held liable for any damages, " +
            "claims or other liabilities direct or indirect, arising from the " +
            "use of this software.\n\nGonZor will from time to time make software " +
            "updates available.  However, GonZor accepts no obligation to provide " +
            "any support to free license holders.\n\nGonZor grants you a limited " +
            "non-exclusive license to use this software for any purpose that does " +
            "not violate any laws that apply to your person in your current jurisdiction, " +
            "subject to the following restrictions: \n\n1. The origin of this software " +
            "must not be misrepresented; you must not claim that you wrote the " +
            "original software.\n2. You must not alter the software, user license " +
            "or installer in any way unless given permission to do so.\n3. This " +
            "notice may not be removed or altered from any distribution.\n4. You " +
            "may not resell or charge for the software.\n5. You may not reverse " +
            "engineer, decompile, disassemble, derive the source code of or modify " +
            "[or create derivative work from] the program without the express " +
            "permission of GonZor.\n6. You must not use this software to engage " +
            "in or allow others to engage in any illegal activity.\n7. You may " +
            "not claim any sponsorship by, endorsement by, or affiliation with " +
            "GonZor228.com\n8. You acknowledge that GonZor owns the copyright and " +
            "all associated intellectual property rights relating to the software.\n\n" +
            " This software license is governed by and construed in accordance " +
            "with the laws of Australia and you agree to submit to the exclusive " +
            "jurisdiction of the Australian courts.\n\nBy clicking the \"I agree\" " +
            "button below, you agree to these software license terms. If you disagree " +
            "with any of the terms below, GonZor does not grant you a license " +
            "to use the software ? exit the window.\n\nYou agree that by your installation " +
            "of the GonZor?s software, you acknowledge that you are at least 18 " +
            "years old, have read this software license, understand it, and agree " +
            "to be bound by its terms.\n\nGonZor reserves the right to update and " +
            "change, from time to time, this software license and all documents " +
            "incorporated by reference. You can always find the most recent version " +
            "of this software license at GonZor228.com.  GonZor may change this " +
            "software license by posting a new version without notice to you. " +
            "Use of the GonZor?s software after such change constitutes acceptance " +
            "of such changes.\n\n1.\tOwnership and Relationship of Parties.\n\nThe " +
            "software is protected by copyrights, trademarks, service marks, international " +
            "treaties, and/or other proprietary rights and laws of the U.S. and " +
            "other countries. You agree to abide by all applicable proprietary " +
            "rights laws and other laws, as well as any additional copyright notices " +
            "or restrictions contained in this software license. GonZor owns all " +
            "rights, titles, and interests in and to the applicable contributions " +
            "to the software. This software license grants you no right, title, " +
            "or interest in any intellectual property owned or licensed by GonZor, " +
            "including (but not limited to) the software, and creates no relationship " +
            "between yourself and GonZor other than that of GonZor to licensee.\n\n" +
            "The software and its components contain software licensed from " +
            "GonZor. The licensor software enables the software to perform certain " +
            "functions including, without limitation, access proprietary data " +
            "on third-party data servers as well as GonZor?s own server. You agree " +
            "that you will use the software, and any data accessed through the " +
            "software, for your own personal non-commercial use only. You agree " +
            "not to assign, copy, transfer, or transmit the software, or any data " +
            "obtained through the software, to any third party. Your license to " +
            "use the software, its components, and any third-party data, will " +
            "terminate if you violate these restrictions. If your license terminates, " +
            "you agree to cease any and all use of the software, its components, " +
            "and any third-party data. All rights in any third-party data, any " +
            "third-party software, and any third-party data servers, including " +
            "all ownership rights are reserved and remain with the respective " +
            "third parties. You agree that these third parties may enforce their " +
            "rights under this Agreement against you directly in their own name.\n\n" +
            "2.\tSupport and Software Updates.\n\nGonZor may elect to provide " +
            "you with customer support and/or software upgrades, enhancements, " +
            "or modifications for the software (collectively, \"Support\"), in its " +
            "sole discretion, and may terminate such Support at any time without " +
            "notice to you. GonZor may change, suspend, or discontinue any aspect " +
            "of the software at any time, including the availability of any software " +
            "feature, database, or content. GonZor may also impose limits on certain " +
            "features and services or restrict your access to parts or all of " +
            "the software or the GonZor228.com web site without notice or liability.\n\n" +
            "3.  \tFees and Payments.\n\nGonZor reserves the right to charge fees " +
            "for future use of or access to the software in GonZor?s sole discretion. " +
            "If GonZor decides to charge for the software, such charges will be " +
            "disclosed to you 28 days before they are applied if such fees will " +
            "affect your use of the product.\n\n4.\tDisclaimer of Warranties by " +
            "GonZor.\n\nUse of the software and any data accessed through the software " +
            "is at your sole risk. They are provided \"as is.\"  Any material or " +
            "service downloaded or otherwise obtained through the use of the software " +
            "(such as the \"plug-in\" feature) is done at your own discretion and " +
            "risk, and you will be solely responsible for any damage to your computer " +
            "system or loss of data that results from the download and/or use " +
            "of any such material or service.  GonZor, its officers, directors, " +
            "employees, contractors, agents, affiliates, assigns, and GonZor?s " +
            "licensors (collectively ?Associates?) do not represent that the software " +
            "or any data accessed there from is appropriate or available for use " +
            "outside the Australia.\n\nThe Associates expressly disclaim all warranties " +
            "of any kind, whether express or implied, relating to the software " +
            "and any data accessed there from, or the accuracy, timeliness, completeness, " +
            "or adequacy of the software and any data accessed there from, including " +
            "the implied warranties of title, merchantability, satisfactory quality, " +
            "fitness for a particular purpose, and non-infringement.\n\nIf the " +
            "software or any data accessed there from proves defective, you (and " +
            "not the Associates) assume the entire cost of all repairs or injury " +
            "of any kind, even if the Associates have been advised of the possibility " +
            "of such a defect or damages. Some jurisdictions do not allow restrictions " +
            "on implied warranties so some of these limitations may not apply " +
            "to you.\n\n5. \tLimitation of liability.\n\nThe Associates will not " +
            "be liable to you for claims and liabilities of any kind arising out " +
            "of or in any way related to the use of the software by yourself or " +
            "by third parties, to the use or non-use of any brokerage firm or " +
            "dealer, or to the sale or purchase of any security, whether such " +
            "claims and liabilities are based on any legal or equitable theory." +
            "\n\nThe Associates are not liable to you for any and all direct, incidental, " +
            "special, indirect, or consequential damages arising out of or related " +
            "to any third-party software, any data accessed through the software, " +
            "your use or inability to use or access the software, or any data " +
            "provided through the software, whether such damage claims are brought " +
            "under any theory of law or equity. Damages excluded by this clause " +
            "include, without limitation, those for loss of business profits, " +
            "injury to person or property, business interruption, loss of business " +
            "or personal information. Some jurisdictions do not allow limitation " +
            "of incidental or consequential damages so this restriction may not " +
            "apply to you.\n\nInformation provided through the software may be " +
            "delayed, inaccurate, or contain errors or omissions, and the Associates " +
            "will have no liability with respect thereto. GonZor may change or " +
            "discontinue any aspect or feature of the software or the use of all " +
            "or any features or technology in the software at any time without " +
            "prior notice to you, including, but not limited to, content, hours " +
            "of availability.\n\n6.  \tControlling Law.\n\nThis software license " +
            "and the relationship between you and GonZor is governed by the laws " +
            "of Australia without regard to its conflict of law provisions. You " +
            "and GonZor agree to submit to the personal and exclusive jurisdiction " +
            "of the courts located within Australia. The United Nations Convention " +
            "on the International Sale of Goods does not apply to this software " +
            "license.\n\n7.\tPrecedence.\n\nThis software license constitutes the " +
            "entire understanding between the parties respecting use of the software, " +
            "superseding all prior agreements between you and GonZor.\n\n8.\tSurviving " +
            "Provisions.\n\nSections 1, and 3 through 5, will survive any termination " +
            "of this Agreement.\n\n---------------------------------------------------------------------------------" +
            "---\nIf you accept the terms of the agreements, click I Agree to continue. " +
            " You must accept the agreement to download and use the software. ");
        scroll.setBounds(new Rectangle(36, 36, 478, 305));
        this.getContentPane().add(readcheck);
        readcheck.setVisible(false);
       this.getContentPane().add(scroll);
       textscroll = new JScrollPane (scroll, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        textscroll.setBounds(36,36,400,400);
          getContentPane().add( textscroll );
        this.getContentPane().add(background);
      JLabel background = new JLabel();
      JCheckBox readcheck = new JCheckBox();
      JTextArea scroll = new JTextArea();
    }Sorry about all the text for the agreement. I've tried a number of different things I got from searching the forums at different points in the code (setting the number of rows/columns, setting max and min sizes, etc etc) The code above that wraps the text I could have sworn I tried 3 times before it magically worked... I also tried using the awt component for textareas that had the scrollbars built in, but scrapped it after having even more difficulties with that one. I'm trying to get the textbox to only go down about 300 px and 300 px to the right. Using the graphical editor to change it produces a null pointer error at compile time(?!?). Can anyone help me to get the textbox to render as I want it to?
    Edited by: rpk5000 on Jan 27, 2008 9:43 AM

    for instance, boxlayout would work nicely with the installer frame (or dialog)
    import java.awt.Dimension;
    import java.awt.EventQueue;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.BorderFactory;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    public class InstalleFrame
        public InstalleFrame()
            try
                jbInit();
            catch (Exception ex)
                ex.printStackTrace();
        private JScrollPane textscroll;
        private JPanel contentPane = new JPanel();
        private JLabel background = new JLabel();
        private JCheckBox readcheck = new JCheckBox();
        private JTextArea scroll = new JTextArea();
        private void jbInit() throws Exception
            contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS));
            contentPane.setBackground(UIManager.getColor("window"));
            contentPane.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
            scroll.setWrapStyleWord(true);
            scroll.setLineWrap(true);
            String text = "Copyright ? 2006-2007 GonZor228.com \n\nBy using or distributing this "
                            + "software (or any work based on the software) you shall be deemed "
                            + "to have accepted the terms and conditions set out below.\n\nGonZor228.com "
                            + "(\"GonZor\") is making this software freely available on the basis "
                            + "that it is accepted as found and that the user checks its fitness "
                            + "for purpose prior to use.\n\nThis software is provided \'as-is\', without "
                            + "any express or implied warranties whatsoever. In no event will the "
                            + "authors, partners or contributors be held liable for any damages, "
                            + "claims or other liabilities direct or indirect, arising from the "
                            + "use of this software.\n\nGonZor will from time to time make software "
                            + "updates available.  However, GonZor accepts no obligation to provide "
                            + "any support to free license holders.\n\nGonZor grants you a limited "
                            + "non-exclusive license to use this software for any purpose that does "
                            + "not violate any laws that apply to your person in your current jurisdiction, "
                            + "subject to the following restrictions: \n\n\nblah, blah, blah,..."
                            + "\n\n";
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < 5; i++)
                sb.append(text);
            scroll.setText(sb.toString());
            contentPane.add(readcheck);
            contentPane.add(scroll);
            textscroll = new JScrollPane(scroll,
                    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                    JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            textscroll.setPreferredSize(new Dimension(400, 400));
            contentPane.add(textscroll);
            JPanel bottomPane = new JPanel();
            bottomPane.setOpaque(false);
            final JButton okButton = new JButton("OK");
            final JButton cancelButton = new JButton("Cancel");
            okButton.setEnabled(false);
            readcheck.setOpaque(false);
            readcheck.setText("I have read and accept the license agreement");
            readcheck.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    JCheckBox radioBtn = (JCheckBox)e.getSource();
                    if (radioBtn.isSelected())
                        okButton.setEnabled(true);                   
                    else
                        okButton.setEnabled(false);
            okButton.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    // TODO: whatever needs to be done here
            cancelButton.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    SwingUtilities.getWindowAncestor(contentPane).dispose();
            bottomPane.add(readcheck);
            bottomPane.add(okButton);
            bottomPane.add(cancelButton);
            contentPane.add(bottomPane);
            //readcheck.setVisible(false);
            contentPane.add(background);
        public JPanel getContentPane()
            return contentPane;
        public static void main(String[] args)
            EventQueue.invokeLater(new Runnable()
                public void run()
                    InstalleFrame install = new InstalleFrame();
                    JFrame frame = new JFrame("Install");
                    frame.getContentPane().add(install.getContentPane());
                    frame.setDefaultCloseOperation(3);
                    frame.setSize(550, 400);
                    frame.setUndecorated(false);  //**
                    frame.pack();  //**
                    frame.setLocationRelativeTo(null); //**
                    frame.setVisible(true);
    }

  • Multi line column JTable

    Hi,
    I am working on JTable and I am using DefaultTableModel.
    I have a requirement that in one of the cells I need to show a multi line text which may contain 10 to 50 lines of text.I need to show all the text even on resizing the table.
    Can anyone give me suggessions regarding this.
    Thanks,
    Bussa.

    Hi,
    Write your custom JTableCellEditor and Renderer to install a JTextArea on the cell you want.
    You can set the size of the larger row separately via
    JTable.setRowHeight(int row, int value); To display the full text you should set
    JTextArea.setLineWrap(true);
    JTextArea.setWrapStyleWord(true);and set the width of the JTextArea static.
    after this calculate the height of the JTextArea and set it to the table.
    Olek

  • Dynamically expanding resume

    Hi,
    I'm currently working on a project that allows users to create their own resumes from a set of templates. Below is a picture of one template that I'm using for testing purposes.
    http://content.screencast.com/users/hamedn/folders/Jing/media/61fa8030-8435-4fba-aefb-ad9b b51e1a96/2013-07-15_1350.png
    Currently the way that it works is that I've tagged a fixed number of repeating textboxes (Date, Title, Location, Details) and with their parent tag as ExperienceItem, and then exported this as an XML file. The key of the application is that the user can edit the XML file however he wishes, and then I use Import XML to import his XML into the template and give him the outputted PDF file. However, there are a few things I need that I haven't figured out how to do yet. Any help would be greatly appreciated:
    1. How do I make it so that if the user adds a lot of extra text (or very little) to one of the textboxes (such as the details textbox), the template shifts accordingly? So if there's one line, the other textboxes below shift upward to fill the empty space and the opposite if there's too much text.
    2. How do I make the template more dynamic? I don't want to have to have 10 placeholder textboxes. Users should put as many or as little ExperienceItem's into the XML file, and the template should create as many items in the list as ExperienceItems.
    3. How do I let extra content flow into the next page?
    Thank you very much for the help!
    -Hamed

    Since this is the swing forum I will assume that you are using a JTextArea. Use:
    JTextArea.setLineWrap(true);
    JTextArea.setWrapStyleWork(true);
    Those will cause word wrap. If you don't want to wrap by word then don't add the second method call.

  • Dynamically Expanding TextArea while Typing

    Hello,
    I need to be able to have a TextArea that expands to a newline when my text exceeds the size of the TextArea. Initially it has to be 1 line, and about 20 columns wide. When I reach the right edge, I need to add another line to the TextArea (keeping the width constant) and have the text begin on the next line.
    Has anyone ever done this?
    Thank you!!

    Since this is the swing forum I will assume that you are using a JTextArea. Use:
    JTextArea.setLineWrap(true);
    JTextArea.setWrapStyleWork(true);
    Those will cause word wrap. If you don't want to wrap by word then don't add the second method call.

  • Resize window, urgent!!!!

    Hi Guys,
    I am experiencing a problem about resize window.
    In my swing application, I use a Textarea. In the textarea, also, i set the boundary.
    In the textarea, I display some strings. Right now, the problem is that when I resize the window, the string can not be fit in the textarea. The string can not be shrink and expend.
    Do you have any ideas about that.
    Thanks in advance.
    Eddy

    very simple.
    use jtextarea.setLineWrap(true)
    and jtextarea.setWordWrapStyle(true)
    or somethind like this.
    Look the api for this methods.

  • Cant Get Text To Show In JTextArea

    Hi guys,
    I'm trying to create a very simplistic GUI where the output of an IRC server is shown in a JTextArea. However for the life of me I can not get any text at all to show in the text area. Here's the class that creates the user interface:
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    public class SwingTest extends javax.swing.JFrame implements ActionListener {
         JButton connect = new JButton("Connect");
         JTextArea chat = new JTextArea();
        public SwingTest() {
             //set the title of the frame
             super("Chat Window");
             //set the size of the frame
             setSize(800, 600);
             //set what happens when the close button is clicked
             setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             // create the scroll pane to add the text area to
             chat.setLineWrap(true);
             JScrollPane scroll = new JScrollPane(chat, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
             //create the container panel
             JPanel jp = new JPanel();
             //create the layout manager and assign it to the container panel
             BoxLayout horizontal = new BoxLayout(jp, BoxLayout.Y_AXIS);
             jp.setLayout(horizontal);
             //add the text area and button to the container panel
             jp.add(scroll);
             jp.add(connect);
             //add the container panel to the frame
             add(jp);
             //make the frame and its contents visible
             setVisible(true);
             //add an event listener to the connect button
             connect.addActionListener(this);
        public void actionPerformed(ActionEvent event) {
             int temp = 1;
             SockThread mySock = new SockThread();
                 try {
                      Thread.sleep(20000);
                  while(temp == 1) {
                   while(mySock.pinger != false) {
                        chat.append(mySock.getStatus()+ "\n");
                        mySock.pinger = false;
                        break;
                 } catch  (InterruptedException ie) {
                      chat.setText("Error " + ie.getMessage());
        public static void main(String[] arguments)  {
             //create an instance of the SwingTest class and let it do its thing
             SwingTest st = new SwingTest();
    }

    Thanks hiwa, i did what you suggested and created a worker thread, but still I'm getting nothing in that JTextArea. I'm new to working with worker threads though, so if anyone wouldn't taking a look at my code just to see if I'm doing something wrong i would greatly appreciate it.
    Here is my worker class:
    import javax.swing.*;
    public class ChatWorker extends SwingWorker {
         String messages;
         String output;
         JTextArea chat;
         public ChatWorker() {
              super();
         protected String doInBackground() {
              int temp = 1;
              SockThread st = new SockThread();
              try {
                   Thread.sleep(20000);
                   //Perpetual loop needed to keep checking for server messages
                   while(temp == 1) {
                   while(st.pinger != false) {
                        messages = st.getStatus();
                        st.pinger = false;
                        break;
              } catch (InterruptedException ie) {
              return messages;
    }And here is the update gui class to make use of the worker thread:
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import java.beans.*;
    public class SwingTest extends javax.swing.JFrame implements ActionListener, PropertyChangeListener {
         JButton connect = new JButton("Connect");
         JTextArea chat = new JTextArea();
         ChatWorker cw;
        public SwingTest() {
             //set the title of the frame
             super("Chat Window");
             //set the size of the frame
             setSize(800, 600);
             //set what happens when the close button is clicked
             setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             // create the scroll pane to add the text area to
             chat.setLineWrap(true);
             JScrollPane scroll = new JScrollPane(chat, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
             //create the container panel
             JPanel jp = new JPanel();
             //create the layout manager and assign it to the container panel
             BoxLayout horizontal = new BoxLayout(jp, BoxLayout.Y_AXIS);
             jp.setLayout(horizontal);
             //add the text area and button to the container panel
             jp.add(scroll);
             jp.add(connect);
             //add the container panel to the frame
             add(jp);
             //make the frame and its contents visible
             setVisible(true);
             //add an event listener to the connect button
             connect.addActionListener(this);
        public void actionPerformed(ActionEvent event) {
             try {
             cw = new ChatWorker();
             cw.addPropertyChangeListener(this);
             cw.execute();
             } catch (Exception exc) {
        public void propertyChange(PropertyChangeEvent event) {
             try {
                  String tempText = (String)cw.get();
                  chat.append(tempText + "\n");
             }catch (Exception exc) {
        public static void main(String[] arguments)  {
             //create an instance of the SwingTest class and let it do its thing
             SwingTest st = new SwingTest();
    }

  • Can't update text in JTextArea! Can you help?

    [Update: If I remove the transparency everything is fine. However, I really need the transparency..]
    Hi,
    I have the simplest question, but I can't seem to get an answer to it. The problem is very simple: I have defined a JTextArea and I'm reading text into it. The problem is that the old text does not disappear, and the new text is pasted on top, making it unreadable. As an "act of desperation" I fixed this by setting the area invisible, updating it and setting it visible again, as you can see in the code. It works, but now it blinks in the screen (quite annoying!).
    Is there a smarter way to to this? I need this on a transparent window (see class init below), overlayed on another JFrame.
    I am on Mac OS X.
    I hope some of you can help me with this problem
    Thanks a lot in advance
    Lele
    public void UpdateOverlay(){
            try{
                BufferedReader b = this.ReadUrl("http://localhost/~"+System.getProperty("user.name")+"/overlaytext.txt");
                this.Overlay.setVisible(false);
                this.OverlayText.read(b, null);
                this.Overlay.setVisible(true);
            }catch(Exception e){
                e.printStackTrace();
        }Here you can see how I have initialized the class
    public class MyClass {
        //Overlay section
        public JFrame Overlay=new JFrame("Overlay");
        public Color OverlayColor=new Color(0.0f,0.0f,0.0f,0.0f);
        public JTextArea OverlayText=new JTextArea();
        public long Refresh_time=200;//ms
        /** Creates a new instance of MyClass */
        public MyClass(AWT1UpFrame f) {
            int width=270,height=170,border_x=20,border_y=20;
            //Initialize Overlay
            this.Overlay.setVisible(false);
            this.Overlay.setBackground(this.OverlayColor);
            this.Overlay.setLocationRelativeTo(null);
            this.Overlay.setUndecorated(true);
            this.Overlay.setSize(width,height);
            System.out.println("loc="+f.getLocation());
            int x = f.getLocation().x+border_x;
            int y = f.getLocation().y +f.getSize().height - border_y - height;
            this.Overlay.setLocation(x, y);
            this.Overlay.add(this.OverlayText);
            this.Overlay.setAlwaysOnTop(true);
            this.OverlayText.setLineWrap(true);
            this.OverlayText.setWrapStyleWord(true);
            this.OverlayText.setForeground(Color.GREEN);
            this.OverlayText.setBackground(this.OverlayColor);
            this.OverlayText.setFont(new Font("Arial", Font.ROMAN_BASELINE, 16));
    /* and so on*/Edited by: Lele on Oct 25, 2007 4:22 PM

    Hi, so this is the class. If I keep it like this, it simply overwrites old text with the new (like JTextArea thinks that the old text is a part of the background to be buffered). If I set it invisible and back to visible it works, but it blinks.
    How can I let JTextArea understand that it shouldn't consider the old window as a background? Should I use another class?
    Pls keep in mind that I'm on Mac, so maybe it's a Mac-specific thing, but I'd like to know..
    Thanks
    Lele
    package transparency;
    import java.net.*;
    import javax.swing.*;
    import javax.xml.parsers.*;
    import java.awt.*;
    import java.awt.font.*;
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    import java.util.List;
    import apple.awt.CTextArea;
    public class Overlay {
        //Overlay section
        public JFrame Overlay=new JFrame("Overlay");
        public Color OverlayColor=new Color(0.0f,0.0f,0.0f,0.0f);
        public JTextArea OverlayText=new JTextArea();
        public long Refresh_time=200;//ms
        /** Creates a new instance of Overlay */
        public Overlay() {
            int width=270,height=170,border_x=20,border_y=20;
            //Initialize Overlay
            this.Overlay.setVisible(false);
            this.Overlay.setBackground(this.OverlayColor);
            this.Overlay.setLocationRelativeTo(null);
            this.Overlay.setUndecorated(true);
            this.Overlay.setSize(width,height);
            //System.out.println("loc="+f.getLocation());
            //int x = f.getLocation().x+border_x;
            //int y = f.getLocation().y +f.getSize().height - border_y - height;
            //this.Overlay.setLocation(x, y);
            this.Overlay.add(this.OverlayText);
            this.Overlay.setAlwaysOnTop(true);
            this.OverlayText.setLineWrap(true);
            this.OverlayText.setWrapStyleWord(true);
            this.OverlayText.setForeground(Color.GREEN);
            this.OverlayText.setBackground(this.OverlayColor);
            this.OverlayText.setFont(new Font("Arial", Font.ROMAN_BASELINE, 16));
            this.Overlay.setVisible(true);
        public void UpdateOverlay(){
            try{
                //Reading URL
                //String Address="http://localhost/~"+System.getProperty("user.name")+"/overlaytext.txt";
                //URL url= new URL(Address);
                //BufferedReader b = new BufferedReader(new InputStreamReader(url.openStream()));
                //this.Overlay.setVisible(false);
                //this.OverlayText.read(b, null);
                //this.Overlay.setVisible(true);
                //Test
                //this.Overlay.setVisible(false);
                String RandomText="The time is: "+System.currentTimeMillis();
                this.OverlayText.setText(RandomText);
                //this.Overlay.setVisible(true);
            }catch(Exception e){
                e.printStackTrace();
    }.. and this is the main
    package transparency;
    import java.net.*;
    import javax.swing.*;
    import javax.xml.parsers.*;
    import java.awt.*;
    import java.awt.font.*;
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    import java.util.List;
    import transparency.*;
    public class Main {
        /** Creates a new instance of Main */
        public Main() {
        public static void main(String[] args) {
            JFrame f=new JFrame();
            f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
            f.setVisible(true);
            Overlay ov=new Overlay();
            try{
                while(f.isVisible()){
                    ov.UpdateOverlay();
                    Thread.sleep(100);
            }catch(Exception e){
                e.printStackTrace();
    }Edited by: Lele on Oct 26, 2007 3:40 AM

  • JTextArea as ListCellRenderer in JPanel with JSplitPane and text wrapping

    Hi.
    I have problem with JTextArea text wrapping. The JTextArea is used as ListCellRenderer in JList and it has set:
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);I can dynamically add new Notes, modify and remove notes on JList. The capacity of the Text is various so the size of cells is various.
    The JList is in JScrollPane configured like this:
    JList notesList = new JList();
    JScrollPane scrollPane = new JScrollPane(
                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                        JScrollPane.HORIZONTAL_SCROLLBAR_NEVER
    scrollPane.setViewportView(notesList);This scrollPane is put on the left component in the JSplitPane.
    When I put one note with any capacity I want, word wrapping works great even if I move the splitter. The size of cells in JList changes as I want. When JList has more width the cells have less height, when JList has less width the cells height grows because of text wrapping.
    Problem
    Sometimes and I don't know when and why the cells size is fixed.
    I put new note to the list, JList lays the cell, calculate the size and disply it. It is good but when I move splitter the size of the cell is the same. It seems that during moving the splitter the JTextArea doesn't calculate their size.
    I would like in every cell in JList to see whole text wrapped. When I make more width by slider I would like to see whole text with less number of rows. When I make less width with the slider I want to see whole text wrapped and more higher cells.
    Can someone help me where to looking for ideas.

    Hi.
    I have problem with JTextArea text wrapping. The JTextArea is used as ListCellRenderer in JList and it has set:
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);I can dynamically add new Notes, modify and remove notes on JList. The capacity of the Text is various so the size of cells is various.
    The JList is in JScrollPane configured like this:
    JList notesList = new JList();
    JScrollPane scrollPane = new JScrollPane(
                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                        JScrollPane.HORIZONTAL_SCROLLBAR_NEVER
    scrollPane.setViewportView(notesList);This scrollPane is put on the left component in the JSplitPane.
    When I put one note with any capacity I want, word wrapping works great even if I move the splitter. The size of cells in JList changes as I want. When JList has more width the cells have less height, when JList has less width the cells height grows because of text wrapping.
    Problem
    Sometimes and I don't know when and why the cells size is fixed.
    I put new note to the list, JList lays the cell, calculate the size and disply it. It is good but when I move splitter the size of the cell is the same. It seems that during moving the splitter the JTextArea doesn't calculate their size.
    I would like in every cell in JList to see whole text wrapped. When I make more width by slider I would like to see whole text with less number of rows. When I make less width with the slider I want to see whole text wrapped and more higher cells.
    Can someone help me where to looking for ideas.

Maybe you are looking for