Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 15th, 2012, 06:59 PM
Hrithik516 Hrithik516 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 1 Hrithik516 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 14 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old January 3rd, 2013, 07:20 PM
notelek notelek is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 notelek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 57 sec
Reputation Power: 0
Quote:
Originally Posted by Hrithik516
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


maybe try pulling out the final before the JTextArea's

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Need Help in Swing


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap