How to force to wait and get input from a jframe-jpanel?

I would like to use a jframe-jpanel to get user input instead of using JOptionPane.showInputDialog since there will be more than 1 input.
But I could not do it. The code reads the panel lines and passes to other lines below without waiting for the okay button to be pressed.
This is the part of code of my main frame;
jLabel10.setText(dene.toString());
if (dene == 0) {
// todo add button input panel
//String todo_write = JOptionPane.showInputDialog("Please enter a todo item");
JFrame frameTodoAddInput = new JFrame( "Please input..." );
TodoAddAsk1JPanel todoaddpanel = new TodoAddAsk1JPanel();
frameTodoAddInput.add(todoaddpanel);
frameTodoAddInput.setSize( 600, 200 ); // set frame size
frameTodoAddInput.setLocation(300, 300);
//String todo_write = todoaddpanel.getNewTodoItem();
String todo_write = todoaddpanel.getNewTodoItem();
jLabel10.setText("Satir 1822 de".concat(todo_write));
// end of todo add button input panel
todoTextPane1.setText(todo_write);
This is the code of input panel;
* TodoAddAsk1JPanel.java
* Created on May 6, 2007, 12:03 AM
package javaa;
public class TodoAddAsk1JPanel extends javax.swing.JPanel {
/** Creates new form TodoAddAsk1JPanel */
public TodoAddAsk1JPanel() {
initComponents();
private String NewTodoItem = "";
public String getNewTodoItem() {
NewTodoItem = ANewTodoItemTextField.getText();
return this.NewTodoItem;
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
ANewTodoItemTextField = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
PriorityComboBox = new javax.swing.JComboBox();
jLabel3 = new javax.swing.JLabel();
DayValueComboBox = new javax.swing.JComboBox();
MonthValueComboBox = new javax.swing.JComboBox();
YearValueComboBox = new javax.swing.JComboBox();
OkayButton = new javax.swing.JButton();
CancelButton = new javax.swing.JButton();
TimeValueComboBox = new javax.swing.JComboBox();
jLabel1.setText("Please enter a todo item:");
jLabel2.setText("Please select its priority level:");
PriorityComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "A", "B", "C" }));
jLabel3.setText("Please select its due date:");
DayValueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));
MonthValueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }));
YearValueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026", "2027", "2028", "2029", "2030", "2031", "2032", "2033", "2034", "2035", "2036", "2037", "2038", "2039", "2040", "2041", "2042", "2043", "2044", "2045", "2046", "2047", "2048", "2049", "2050", "2051", "2052", "2053", "2054", "2055", "2056", "2057", "2058", "2059", "2060", "2061", "2062", "2063", "2064", "2065", "2066", "2067", "2068", "2069", "2070" }));
OkayButton.setText("OK");
OkayButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
OkayButtonActionPerformed(evt);
CancelButton.setText("Cancel");
TimeValueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00", "18:30", "19:00", "19:30", "20:00", "20:30", "21:00", "21:30", "22:00", "22:30", "23:00", "23:30", "00:00", "00:30", "01:00", "01:30", "02:00", "02:30", "03:00", "03:30", "04:00", "04:30", "05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00" }));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(PriorityComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(ANewTodoItemTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 279, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(OkayButton, javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 133, Short.MAX_VALUE)
.addComponent(CancelButton))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(DayValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(MonthValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(YearValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(13, 13, 13)
.addComponent(TimeValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(42, 42, 42)))
.addContainerGap())
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ANewTodoItemTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(PriorityComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(DayValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(MonthValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(YearValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(TimeValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(OkayButton)
.addComponent(CancelButton))
.addContainerGap())
}// </editor-fold>
private void OkayButtonActionPerformed(java.awt.event.ActionEvent evt) {                                          
// TODO add your handling code here:
NewTodoItem = ANewTodoItemTextField.getText();
// Variables declaration - do not modify
private javax.swing.JTextField ANewTodoItemTextField;
private javax.swing.JButton CancelButton;
private javax.swing.JComboBox DayValueComboBox;
private javax.swing.JComboBox MonthValueComboBox;
private javax.swing.JButton OkayButton;
private javax.swing.JComboBox PriorityComboBox;
private javax.swing.JComboBox TimeValueComboBox;
private javax.swing.JComboBox YearValueComboBox;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
// End of variables declaration
I want to get the resulted input of "NewTodoItem"
Thanks in advance for your kind help.
Guven

Thank you very much for your help. But I would like
to get 3 inputs from 1 window at the same time and I
could not find any example code for JDialog for more
than 1 input. If any body can show how to write this
code, it would be appreciated.
ThanksYou can write your own. A JDialog is a container just look a JFrame is.

Similar Messages

  • How to write the data and get back from NI-9802 installed in cRIO 9081

    Hello,
             I am working on cRIO 9081, with NI-9467 GPS module and NI-9234 Acoustic module. I have generated the data from GPS as well as 9234 module.
    Now I want to write this data in NI-9802, this means i required 2 FPGA vi in one project, and to dumb them in main RT vi.
    So how can we do it ,please suggest me any solution...

    You can use webutil functions.
    There are many posts in the forum... search for them!!
    hope it helps you,
    Fabrizio
    If this answer is helpful or correct, please mark it. Thanks.

  • How can i set action on UITaBar and get event from that

    Hi All,
    I m doing one apps in which i have to add three UITabBarItem and this is UITabBarSystemItem.
    Now i cannot understand that how can i set action and get event from the?
    And how can i set various views on three tab bar item.
    I have to use UITabBar means i have to use UINavigationController+UITabBar
    My code id
    tabBar =[[UITabBar alloc] initWithFrame:CGRectMake(0,370,320,50)];
    tabBar.backgroundColor =[UIColor blackColor];
    UITabBarItem *search =[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:0];
    UITabBarItem *recents =[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemRecents tag:1];
    UITabBarItem *favorites =[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorit es tag:2];
    tabBar.items =[[NSArray arrayWithObjects:search,recents,favorites, nil] retain];
    tabBar.selectedItem = search;
    [myView addSubview:tabBar];
    [tabBar release];
    I add a action:
    UITabBarItem *search =[[UITabBarItem alloc] InitWithTabBarSystemItem:UITabBarSystemItemSearch tag:0 action:@selector(select:)];
    So it error: Warning -no'InitWithTabBarSystemItem:tag:action:' method fount
    So any can help me regarding it?

    Thanks RickMaddy very much.
    I read and do with sample at the View Controller Programming Guide . But when run it only view TabBar with title but haven't got any TabBarItem on it. I searched a few example about TabBar and i did, but i want do a form with a button then press on button it view a form with 2 TabBarItem on TabBar and press each TabBarItem will show correlative form page 1, page 2.
    UITabBarController *tabBarControl = [[[UITabBarController alloc] initWithNibName:nil bundle:nil] autorelease];
    tabBarControl.title = @"Tab bar";
    ViewControl1 *view1 = [[[ViewControl1 alloc] initWithNibName:@"ViewControl1" bundle:nil] autorelease];
    ViewControl1 *view2 = [[[ViewControl1 alloc] initWithNibName:@"ViewControl2" bundle:nil] autorelease];
    tabBarControl.viewControllers = [NSArray arrayWithObjects:view1,view2,nil];
    [self.navigationController pushViewController:tabBarControl animated:YES];

  • I bought a gift card, but it hasn't shown up in my e-mail after 1 hour.  How can I find it and get the credit on my account?

    I bought an iTune gift card for myself and sent it to my e-mail address.  I have waited over an hour and the e-mail showing the gift card has not arrived.  How do I find it and get the credit put into my iTunes account so that I can buy some music?

    Oh hold on - sudden development!
    I panicked and force-shut down my computer because it froze after I clicked on the 'Reset Cache' option, then I logged back on and noticed the Cloud symbol next to the missing song. I clicked it, and it's finally downloaded properly! <3
    Mate, thank you so much for helping me out! xxx

  • How to get input from card reader

    hi, everyone,
    I have a project, which needs me to get input from card reader. My terminal input is IBM POS system, but it didnot provide the API to get the input. How can I get the input? Need your help so much! and thanks a lot

    Now this is a wild idea.... how about searching the IBM site for technical information ?

  • How can i get input from user in Workflows

    Hello professionals,
    I'm new to SAP B1 Workflow, i have created some workflows and they all worked fine.
    But, I am wondering, How can i get input from user?. For example, i want to display list of options to choose between them and route the workflow based on the selected option. I don't want to use the exclusive gateway and check for some conditions, i want to get input from user.
    How can i do that?
    Thanks in advance,
    Kareem Naguib

    Hi,
    Please refer SAP help file:
    http://help.sap.com/saphelp_sbo900/helpdata/en/b8/1f9a1197214254b79bcf8f93f9fff9/content.htm?frameset=/en/44/c4c1cd7ca22…
    Thanks & Regards,
    Nagarajan

  • How to Get Input from Command Prompt?

    How can i get input from command prompt like
    C:\
    or linux ?
    (Here's what I use now)
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String line;
    Whlie((line=in.readLine())!= null)
    { System.out.prinln( line) ; }
    IS THERE A BETTER WAY?

    The main method within a java class accepts command line input through a String array.
    In this example args is the String array. You can access the parameters as args[0] for the first parameter, args[1] for the second parameter, etc....
    The usage for the example below would be :
    c:\EDIFormat file1 file2
    Where args[0] would equal file1 and args[1] would equal file2.
    public class EDIFormat {
    public static void main(String[] args) {
              if (args.length < 0) {
                   System.out.println("No Parameters supplied. Exiting....");
                   // open input and output files
                   EDIFiles(args[0], args[1]);
    Hope that helps!

  • How do i get input from the user?

    For example if i wanted to ask "Whats your favorite number" and then get the input from the user and assign it to a variable how would i go about doing that?

    hi,
    if you want to get input from your console your should work with io(input and output).The BufferedReader class, InputStreamReader class
    you should import "java.io.BufferedReader" and "java.io.InputStreamReader" package, and do something like this:
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    String favoriteNumber;
    System.out.println("Whats your favorite number ");
    favoriteNumber = input.readLine();
    System.out.println ("Your favorite Number Is " + favoriteNumber);
    if its a gui you should import "javax.swing.JOptionPane" and do the following
    String favoriteNumber = JOptionPane.showInputDialog(null, "Enter your favorite Number", "Favorite Number", JOptionPane.INFORMATION_MESSAGE);
    anjiie([email protected]).

  • HT5787 How long should i wait to get my new password of my Apple ID?

    Hello. I made a reinitialization by mail of my old password for Apple ID. How long should i wait to get my new password of my Apple ID?

    Apple ID security issues -
    Call Apple Care for your country and ask for the Account Security Team. They can assist you with your issue.
    http://support.apple.com/kb/HT5699

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • When trying to open iphoto I get the error message "You can't open the application iPhoto because it may be damaged or incomplete." How do I fix this and get my photo's back?

    When trying to open iphoto I get the error message "You can't open the application iPhoto because it may be damaged or incomplete." How do I fix this and get my photo's back?

    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    2c: on 10.7 they're at
    /private/var/db/receipts
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    If you purchased it on the App Store you can find it in your Purchases List.

  • How do I re-open and get back into my iPhoto if this message appears: "Your photo library is either in use by another application or has become unreadable"? What do I do?

    How do I re-open and get back into my iPhoto if this message appears: "Your photo library is either in use by another application or has become unreadable"? What do I do?

    Rebuild your iPhoto Library:
    iPhoto 6 and later: Rebuilding the iPhoto library

  • HT201272 Hello there,I delete my scruff application on the 8/05/13. Receipt N: 184052577343. And I was charged ammount of £ 16.99on the 15/05/13. I t's a Subscription Renewal. How can I stop it and get the refund of this ammount back on my account? Thank

    Hello there,I delete my scruff application on the 8/05/13. Receipt N: 184052577343. And I was charged ammount of £ 16.99on the 15/05/13. I t's a Subscription Renewal. How can I stop it and get the refund of this ammount back on my account? Thank you!!

    There are instructions on this page for managing and stopping auto-renewing subscriptions (deleting an app won't stop it) : http://support.apple.com/kb/HT4098
    In terms of a refund, what does it say on the app's description page in the store (a lot say that refunds aren't given) ? But you can try contacting iTunes Support and see if they will refund or credit you : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • How do I create a new account and get stuff from the old account to the new account

    How do I create a new account and get stuff from the old account to the new account

    There are instructions on this page for creating a new account : Set up an Apple ID in iTunes
    Or if you don't want to give credit card details : Create an iTunes Store, App Store, or iBooks Store account without a credit card or other payment method
    But you won't be able to transfer purchases from your old account to it, all content that you download from the store will remain tied to the account that downloaded it.

  • I refuse to pay for a one year automatic subscription for Cosumer report that was charged to my account today without me noticing. How can I cancel that and get reimbursed now?

    I refuse to pay for a one year automatic subscription for Cosumer report that was charged to my account today without me noticing. How can I cancel that and get reimbursed now?
    Patrick

    First turn off auto-renewing subscriptions:
    iTunes Store: Purchasing and managing auto-renewing subscriptions
    Getting a refund won't be as simple. For that you will have to contact iTunes Store Support.

Maybe you are looking for

  • Export to PDF error with embedded font

    Hello, i have added a Barcode font to a report and it is failing to export to PDF now saying it that the "font is not allowed to be embedded in document".  i have tried with two different Barcode fonts A39W and C39W and both fail. I have looked at fo

  • How do you get professional quality digital photos????

    You open a magazine or look online and you'll see celebrity pictures that look crystal clear. How does a consumer get this quality?? Is it the camera?? I plan on buying a new camera soon, a Canon with a Digic II processor, but I want my pictures to l

  • Kindle in read-only mode

    I am using udisksvm to manage my automounts. It works fine for my other USB devices, like external NTFS or fat32 HDDs, but when I plug-in my Kindle (fat32) it gets mounted in ReadOnly mode. I think I configured /usr/share/udisksvm/udisksvm.xml proper

  • ConfigMgr Client Repeatdly uninstalling and reinstalling

    Hi Guys, I have finished installing my SCCM 2012 Primary Site server and Distribution points. I have SCCM 2007 still active and running alongside the environment. I have migrated a handful of test systems across to my SCCM 2012 environment, and for t

  • When I open my iMessage it's blank.

    One day I was going to use iMessage on my iPad but when I opened it it was blank. I can't click on anything at all. I can't read my messages of respond to them. I have tried to reset it before I've searched online but I can't find any solutions. It j