How do I display a JDialog with a JTextArea in it?

Hello.
How do I display a JDialog with a JTextArea in it?

http://java.sun.com/docs/books/tutorial/uiswing/mini/index.html
import javax.swing.*;
import java.awt.*;
public class Test extends JDialog{
     public Test(){
          JPanel contentPane = new JPanel(new BorderLayout());
          JTextArea ta = new JTextArea();
          ta.setText("JDialog with a JTextArea in it");
          setContentPane(contentPane);
          contentPane.add(ta);
          setSize(300,300);
          setVisible(true);
     public static void main(String[] args){
          new Test();
}     

Similar Messages

  • How can I Display a Image with tiff format in Jpanel?

    How can I Display a CMYK Image with tiff format in Jpanel ? Not in ScrollingImagePanel? Thank you in advance.

    Why nobody can help me?I am very anxious!help me,please!

  • How do i display 2 amplitudes with unknown range limits

    How do i display 2 amplitude values in graphs with uknown data for range limits. if both could display in the middle of the graph would be great. Any inputs would help me greatly.
    Thank you,
    Ran

    why separate threads for same question. continue here

  • How can i display my portal  with a certain language in the runtime

    I am imp[lemeting a portal page
    their will be a language choice  English   -   French  - Arabic
    I want the portal page to be displayed in the Arabic if the user choose Arabic
    I want the portal page to be displayed in the French if the user choose French
    I want the portal page to be displayed in the Englis if the user choose English
    How can i achieve that target
    Regards
    Mohamed Hammed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Sandeep
    How can i "Set Language" Portlet
    My portal page contains
    many portlets
    many items
    many subpage links
    i want all of this to function with the chosen language
    Regards
    Mohamed Hammed

  • How do you display xml file with xlst sheet in jsp

    I have an xml file with accompanying xslt file (and several images that are used in a single directory. If I doubleclick on the xml file, it displays perfectly in my browser - Formatting, images and all!
              The 100 dollar question - How do I duplicate this behavior in a JSP page in WebLogic 8.1 using the code in the xml and the accompanying xslt (formatting) file? I tried simple embedding the xml code in the jsp, but that didn't seem to work. What is the secret?
              Okay, I need to add a bit more information here. I understand that it is really easy to just redirect to the XML file. The issue is really security. I want the XML to be inside a jsp that will only allow validated users to view it.
              Another way to look at the problem would be, can I add a jsp security tag to the xml file? Or how to I add the xml code inside a jsp and keep the path references to the xslt and graphics.
              Hope the added information helps
              Thanks,
              Ken
              Message was edited by: KLee - 20050609 10:25 MST
              [email protected]

    This proved out to be the answer. Thanks for the direction!
              import java.io.File;
              import java.io.IOException;
              import java.io.InputStream;
              import java.io.OutputStream;
              import java.io.FileNotFoundException;
              import java.io.FileOutputStream;
              import javax.servlet.ServletException;
              import javax.servlet.http.HttpServlet;
              import javax.servlet.http.HttpServletRequest;
              import javax.servlet.http.HttpServletResponse;
              import javax.xml.transform.Transformer;
              import javax.xml.transform.TransformerConfigurationException;
              import javax.xml.transform.TransformerException;
              import javax.xml.transform.TransformerFactory;
              import javax.xml.transform.stream.StreamResult;
              import javax.xml.transform.stream.StreamSource;
              public class XML_XSLT_Servlet extends HttpServlet {
              protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
                        String xmlfile = req.getParameter("xmlfile"); if (xmlfile==null) xmlfile = "test.xml";
                        String xsltfile = req.getParameter("xsltfile"); if (xsltfile==null) xsltfile = "test.xslt";
                        /* Test if file exists!, or use default file */
                        File f1 = new File(getServletContext().getRealPath("WEB-INF/displayfiles/"), xmlfile);
                        File f2 = new File(getServletContext().getRealPath("WEB-INF/displayfiles/"), xsltfile);
                   if (f1.exists() && f2.exists()) {
                             // System.out.println("Files Found");
                        } else {
                             System.out.println("XML and XSLT Files NOT Found");
                             System.out.println(f1.getPath());
                             System.out.println(f1.getName());
                             xmlfile = "test.xml";
                             xsltfile = "test.xslt";
              InputStream fileXML = getServletContext().getResourceAsStream("WEB-INF/displayfiles/" + xmlfile);
              InputStream fileXSLT = getServletContext().getResourceAsStream("WEB-INF/displayfiles/" + xsltfile);
              OutputStream os = res.getOutputStream();
              TransformerFactory xFactory = TransformerFactory.newInstance();
              StreamSource stylesheet = new StreamSource(fileXSLT);
              Transformer xformer = null;
              try {
              xformer = xFactory.newTransformer(stylesheet);
              } catch (TransformerConfigurationException tfce) {
              tfce.printStackTrace();
              StreamSource input = new StreamSource(fileXML);
              StreamResult output = null;
              try {
              output = new StreamResult(os);
              } catch (Exception e) {
              e.printStackTrace();
              try {
              xformer.transform(input, output);
              } catch (TransformerException xfe) {
              xfe.printStackTrace();
              <pre></pre><pre></pre>

  • HOW do you display multiple componants with the same id e.g. same generated image

    Hi,
    I would like to display two of these with the same id (canvas) which is an image generated through AS
        <canvas:DrawingCanvas id="canvas" >
            </canvas:DrawingCanvas>
    This is an annotation program im working on, and i would 2 of the same view of image, the reason being that the user can view a large and small scale version of the image he/she is working with
    I--------------------I    i----i   - small version
    I                        I    i----i
    I large version   I
    I                        I
    I____________I
    thanks
    art

    You don't need the object to have the same id to achieve your desired results, and you can't have the same object with the same id anyway.
    Just ensure whatever the user does is carried out on the larger and smaller image.
    If this post answers your question or helps, please mark it as such. Thanks!
    http://www.stardustsystems.com
    Adobe Flex Development and Support Services

  • How Can i display a checkbox with list of items

    Hi All,
            How can i include a check box beside the list of items in a combo box/list box
    Here is the requirement which i need to display
    i need to do above requirement. i have to display the check boxes  beside the each item.
    i can show the list of items but unable to show the check boxes.
    Can any one help me regarding this.
    Thanks in advance
    Raghu

    Hope this can help u
    <mx:ComboBox id="cmbtheme" labelField="id" width="30" dropdownWidth="100">
      <mx:itemRenderer>
       <mx:Component>
        <mx:HBox horizontalGap="0">
         <mx:CheckBox id="{data.Nid}" label="{data.label}"/>     
        </mx:HBox>
       </mx:Component>
      </mx:itemRenderer>
    </mx:ComboBox>
    Regards,
    Kapil Arora

  • How can I display a table(with column Header) on the frame(contentPane)?

    (Can dynamically: Insert,remove,modify )
    I have no idea which class I need.

    here's a handy link
    [url http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]tables
    and look into javax.swing.table.TableModel

  • How do I display array values in a text field?

    Hi there-
    I have a small Flash movie I'm trying to complete, it's my
    first go around with Flash 8 so I appreciate your patience:
    I built an array with some actionscript which seems to work
    fine (I can trace it and all is well in the trace window). Now I'm
    simply trying to display it to my Flash movie screen and I've built
    a dynamic text window which is working, except that I only ever get
    the last array element to appear in the dynamic text window. I've
    traced the code and see all of my array values, but when I use
    "myResults_txt.text=picker_array;" I only see the last position's
    value in my array. I tried playing with the "multiline" attribute
    for the text field, it didn't seem to make any difference.
    I'm sure it's probably something silly that I've missed, but
    how do you display an array, with all of it's values to a dynamic
    text field (I even tried using the textArea component but ran into
    the same problem).
    Thanks in advance for any help-
    rich

    Thanks for your input. I tried just about everything but
    ended up re-writing the contents of the array to a var and looping
    through the var. Not my first choice but it got me to done.
    Thanks again,
    Rich

  • How can I display the data in table in separate column?

    I have a vi reading data one by one in the same column.
    How can I display the data with separate column?
    like this:
    data 1 | read | read
    data 2 | read | read
    data 3 | read | read
    (would you mind if I will ask for an example
    because it is much easier for me to work
    with an example)
    THANK YOU.

    If you're reading your data in as a 1D array, this is as simple as using the Reshape Array to make a 2D array. I've attached an example in LabVIEW 6.1 format. The example rearranges a single column of data fill several columns horizontally, but you can easily modify this code to fill the columns downward instead.
    Attachments:
    Data_Column_Example.vi ‏18 KB

  • How can I display the name of my refnum on the front panel?

    I am writing data to a file. To do this, I am using "Open/Create/Replace File" to prompt the user for a filename, which is then output to my VI as a refnum. I then write strings to this file with "Write to Text File".
    How can I display this filename (with the path) on the front panel after the user has input it?
    Michael
    Solved!
    Go to Solution.
    Attachments:
    refnum.JPG ‏45 KB

    Use the Refnum to Path function, in File I/O -> Advanced File Functions palette. You can wire this to a path indicator.

  • Displaying 2 parameters with descriptions in same line of Selection-Screen

    Hi All,
    I want to know how can we display 2 parameters with descriptions in same line of Selection-Screen.
    Means in selection screen first we will give comment as
    <b>Material no</b> then <b>parameter box as MARA-MATNR</b>, In the same line description as <b>Plant</b> then <b>parameter box as T001W-WERKS</b>.
    Material No - BOX - Plant - BOX.
    Can any body tell me how can we do it.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Hi shaik,
    1. define two TEXT-SYMBOLS :
    001     Material
    002     Plant
    and Activate
    2. use this code (just copy paste)
    REPORT abc LINE-SIZE 80.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(10) text-001 FOR FIELD p_matnr.
    PARAMETERS : p_matnr TYPE mara-matnr.
    SELECTION-SCREEN COMMENT 35(10)  text-002 FOR FIELD p_werks.
    PARAMETERS: p_werks TYPE t001w-werks.
    SELECTION-SCREEN END OF LINE.
    regards,
    amit m.

  • How can I display UTF-8 content in a struts portlet

    How can I display UTF-8 (with English and Traditional Chinese mixed characters) content in a struts portlet?
    Version used
    Oracle Portal 10g Release 1 (9.0.4) on Linux
    Portal language support: English only
    Many thanks !!!

    You can utilize multi-lingual support in your Struts portlets, as described in the Portal Developer's Guide.
    Peter

  • Displaying Images along with Drill Drown Results

    I'm using MS access 2003 as my data base and CF as the web
    language. I cannot find a topic in reference to displaying Images
    along with Drill down results. My tables in access have a OLE
    object included however I am clueless as how i can display the
    images with my drill down results. I just cannot find a link that
    talked about this issue already. Does anyone have a link to this
    forum topic?

    College Kid wrote:
    > I'm using MS access 2003 as my data base and CF as the
    web language. I cannot
    > find a topic in reference to displaying Images along
    with Drill down results.
    > My tables in access have a OLE object included however I
    am clueless as how i
    > can display the images with my drill down results. I
    just cannot find a link
    > that talked about this issue already. Does anyone have a
    link to this forum
    > topic?
    >
    Sorry, no link, but I think you want to be looking at the
    <cfimage...>
    and|or the <cfcontent...> tags. One or both of these
    tags should allow
    you to deliver the image from the database to the client.
    You are doing this in a bit of an unusual, but not unheard of
    way. Most
    people just store the image file in a handy directory
    accessible to the
    web server and then store the name|URL to this image as text
    in the
    database.
    But it is definitly possible to server up binary image data
    as well.
    Though I have never heard of this in conjunction with MS
    Access and 'OLE
    objects'. I usually hear this discussed in relation to more
    enterprise
    database management systems and BLOB [Binary Large OBjects]
    data fields.

  • How do I get my new 27" Thunderbolt Display to work with my mid-2010 Macbook Pro?

    How do I get my new 27" Thunderbolt Display to work with my mid-2010 Macbook Pro? Or am I SOL?
    Hardware Overview:
      Model Name:    MacBook Pro
      Model Identifier:    MacBookPro6,1
      Processor Name:    Intel Core i7
      Processor Speed:    2.8 GHz
      Number of Processors:    1
      Total Number of Cores:    2
      L2 Cache (per Core):    256 KB
      L3 Cache:    4 MB
      Memory:    8 GB
      Processor Interconnect Speed:    4.8 GT/s
      Boot ROM Version:    MBP61.0057.B0F
      SMC Version (system):    1.57f18

    You can't. Theoretically, Thunderbolt devices that only transfer video and audio should work with Mini DisplayPort MacBooks like yours, but it's not the case of the Thunderbolt Display. Its firmware doesn't allow it to be used with non-Thunderbolt Macs, so you can't use the Thunderbolt Display with the Mid 2010 MacBook Pro.
    Instead, you have to look for another screen, or you can get an adapter and connect the MacBook Pro to a TV

Maybe you are looking for

  • Error while invoking WorkFlow thru a link

    All, I have created a link which shows up on END USER HOME PAGE, this link in turn has to invoke the Update user workflow. When i click on that link...i get this ERROR :- View access denied to Subject xxxx on TaskDefinition: Workflow-UpdateUser. I tr

  • How to download the ALV Hierchial Tree Data to an Excel sheet.

    Hi All, Can any body please let me ,if there is any possibility to know How to download the ALV Hierchial Tree Data to an Excel sheet. If yes, please let me know how could this can b acheived. Regards, Rohini.

  • FM to convert character type to hexadecimal type

    I have to make an object unicode compliant . in the object the password is created using paskey and bcode. Bcode contains all alphanumeric or alphabets. and paskey is numeric. to create password passkey and bcode are subtracted bit by bit. now the pr

  • Database errors - Publisher?

    Hello, Our DBAs are saying the Portal db is throwing these errors: Subject: SQL Server Alert System: 'Demo: Sev. 20 Errors' occurred on \\PlumtreeServerDB DATE/TIME:     7/1/2008 10:13:57 PM DESCRIPTION:     Error: 17805, Severity: 20, State: 3 Inval

  • Update to 4.1 has totally crashed my Ipod Touch

    I just connected my IPod Touch, 8GB, 2nd generation to ITunes and was was asked to update to version 4.1 of the Ipod Touch OS. This download took about 2 hrs and then did not "take" and the system restore failed so now my IPod is "stuck" in restore m