Results 1 to 3 of 3
  1. #1
    Hrithik516 is offline Member
    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Default Need Help in Swing

    I have tried the below two ways

    FIRST: String str = queryTextArea.getText();
    final JTextArea textArea = new JTextArea();
    textArea.setFont(new Font("Sans-Serif", Font.PLAIN, 12));
    textArea.setText(str);
    textArea.setCaretPosition(0);
    JScrollPane scrollPane = new JScrollPane(textArea);
    scrollPane.setPreferredSize(new Dimension(350, 150));
    JOptionPane pane = new JOptionPane(scrollPane, JOptionPane.PLAIN_MESSAGE,JOptionPane.PLAIN_MESSAG E);
    JDialog dialog = pane.createDialog(null, "Query");
    dialog.setResizable(true);
    dialog.setVisible(true);



    String str = queryTextArea.getText();
    final JTextArea textArea = new JTextArea();
    textArea.setFont(new Font("Sans-Serif", Font.PLAIN, 12));
    textArea.setText(str);
    textArea.setCaretPosition(0);
    JScrollPane scrollPane = new JScrollPane(textArea);
    scrollPane.setPreferredSize(new Dimension(350, 150));
    int res = JOptionPane.showConfirmDialog(null,scrollPane,"Que ry", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
    System.out.println( "showInputDialog: " + res );
    if(res==0)
    queryTextArea.setText(textArea.getText());


    Please help in having a doc-Modal

    Thanks

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Need Help in Swing

    Already answered in your cross-post. Locking. Please do not cross-post without notifying all that you're doing this. Else you're not being fair to the volunteers in either forum.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,229
    Rep Power
    19

Similar Threads

  1. I need help about swing...
    By CANN1 in forum AWT / Swing
    Replies: 2
    Last Post: 03-31-2012, 02:50 PM
  2. Swing
    By tmotse in forum AWT / Swing
    Replies: 0
    Last Post: 03-31-2010, 10:18 AM
  3. swing.jar
    By krrishnak in forum AWT / Swing
    Replies: 2
    Last Post: 04-05-2009, 05:29 AM
  4. AWT or Swing
    By bugger in forum AWT / Swing
    Replies: 4
    Last Post: 11-22-2007, 09:44 AM
  5. map javax.swing.text.Element to javax.swing.text.View
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 07-30-2007, 07:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •