Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1034

Re: Creating JTextArea on

From gethostbyname@gmail.com.remove-dii-this
Subject Re: Creating JTextArea on
Message-ID <1172458566.252530.165100@z35g2000cwz.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <NipEh.7448$s72.4213@fe12.news.easynews.com>
Date 2011-04-27 15:31 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On 25 fev, 20:52, "TonyB" <t...@kerrisway.freeserve.co.uk> wrote:
> I'm trying out a simple gui. I'm trying to create an text area to allow me
> to display some text from inside the app if a menu item is clicked. I think
> JTextArea will do the job, but I'm having problems making it appear.
> The code to add to my container is
>         Container contentPane = frame.getContentPane();
>         JTextArea itemArea = new JTextArea();
>         contentPane.add(itemArea);
> is the contentPane the main area of the window ?
> Tony

Post the complete source code to I understand what you are doing with
frame reference.

Look a simple working source code:

-------------------------------------------------------------
package javaapplication3;

import javax.swing.JFrame;
import javax.swing.JTextArea;

public class Main extends JFrame {
    private JTextArea textArea;

    public Main() {
        super("PH");

        setSize(500,500);
        setVisible(true);


        textArea = new JTextArea();
        getContentPane().add(textArea);


    }

    public static void main(String[] args) {
        Main application = new Main();
        application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

}

-------------------------------------------------------------


gethostbyname

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Creating JTextArea on mai "TonyB" <tonyb@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
  Re: Creating JTextArea on gethostbyname@gmail.com.remove-dii-this - 2011-04-27 15:31 +0000
    Re: Creating JTextArea on gethostbyname@gmail.com.remove-dii-this - 2011-04-27 15:31 +0000
      Re: Creating JTextArea on "TonyB" <tonyb@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
  Re: Creating JTextArea on "Michael Dunn" <michael.dunn@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
  Re: Creating JTextArea on gethostbyname@gmail.com.remove-dii-this - 2011-04-27 15:31 +0000

csiph-web