How do I keep track of dialog boxes?

If I have a three question test, How do I keep track of the answers?

OK a bit of sanity.
you have a 3 question test.
presumably you have a 3 element array of questions (Strings?)
String[] questions = {"What is 1 + 1","What is 2 + 2","What is 3 + 3"};
in a loop you ask each question, then get the response to each.
String answer = .....readLine();
if you change this to an object
class Question
  String question;
  String answer;
  public Question (String q){question = q;}
}then your array looks like this
Question[] questions = {new Question("What is 1 + 1"), etc
so now the display of the question changes from
System.out.print(questions[x]);
to
System.out.print(questions[x].question);
likewise for the answer
from
String answer = .....readLine();
to
questions[x].answer = .....readLine();
now, in your Question array, each 'question' stores the answer received

Similar Messages

  • TS1389 when i changed my browser to IE 8, I am no longer able to play the songs I purchased. I keep getting a dialog box saying "this computer is not authorized to play this song. Would you like to authorize it? The box has an old apple ID . How do I get

    I try to play the Itunes song I purchased. I have a new computer, another internet provider since I purchased the songs, and have switched to a new internet browser Internet Explorer 8. I keep getting a dialog box saying "this computer is not authorized to play the song. would you like to authorize it?
    An old Apple ID popps up and I am asked for the old passwork which I no longer remember. I successfully changed to a new Apple ID and password.
    when I enter that, a new dialog box appears, saying "this computer is already authorized." When I try to play the song the first box appears again,
    I I go round over and over, with no success playing my songs. Can anybody out their resolve this? Thanks for any help

    Were these songs purchased using another account?
    " I opened a new iTunes account and copied the files to the new account.  "
    Do you mean to a new library?
    Account is a user neame and password with which you purchase content.
    A library is your collection of media.

  • Photoshop 3 I keep getting a dialog box saying the program is not responding

    I keep getting a dialog box saying "Program is not responding" after opening up Photoshop Elements 3.
    I have to shut the program down and start over.

    This isn't actually the Elements forum, which you can find at:
    https://forums.adobe.com/community/photoshop_elements
    You need to tell them what operating system you are using, and what circumstances causes Elements to freeze.  Does restarting the computer make a difference?  How long has this been happening, and can you correlate to something you have done or installed, like fonts or third party plugins?
    Good luck

  • How can I automatically close a dialog box using Javascript after I click the OK button to submit it?

    How can I automatically close a dialog box using Javascript after I click the OK button to submit it? I don't want to have to X out of the dialog box after I am done.
    Thanks
    Linda

    JS can not interact with open dialogs in any way, unless it's a dialog
    created in JS using the Dialog object.
    On Thu, Jul 24, 2014 at 11:13 PM, lindaeliseruble <[email protected]>

  • How to open a 'Save As' Dialog box in JSP?

    Hi all, i need to export a CSV file. A button is provided to the user to choose the directory to save the file. My problem is how to open a 'Save As' dialog box in JSP?
    Thanks in advance

    Hi,
    Below is my full code to download fiel but still the Save Dialog box still not show..
    <%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld"
    %><%@ taglib prefix="asset" uri="futuretense_cs/asset.tld"
    %><%@ taglib prefix="assetset" uri="futuretense_cs/assetset.tld"
    %><%@ taglib prefix="commercecontext" uri="futuretense_cs/commercecontext.tld"
    %><%@ taglib prefix="ics" uri="futuretense_cs/ics.tld"
    %><%@ taglib prefix="listobject" uri="futuretense_cs/listobject.tld"
    %><%@ taglib prefix="render" uri="futuretense_cs/render.tld"
    %><%@ taglib prefix="siteplan" uri="futuretense_cs/siteplan.tld"
    %><%@ taglib prefix="searchstate" uri="futuretense_cs/searchstate.tld"
    %><%@ taglib prefix="locale" uri="futuretense_cs/locale1.tld"
    %><%@ taglib prefix="dateformat" uri="futuretense_cs/dateformat.tld"
    %><%@ taglib prefix="blobservice" uri="futuretense_cs/blobservice.tld"
    %><%@ taglib prefix="satellite" uri="futuretense_cs/satellite.tld"     
    %><%@ taglib prefix="date" uri="futuretense_cs/date.tld"
    %><%@ page import="COM.FutureTense.Interfaces.*,
    COM.FutureTense.Util.ftMessage,
    COM.FutureTense.Util.ftErrors"
    %><%@ page import="COM.FutureTense.Interfaces.*,
    COM.FutureTense.Util.ftMessage,
    COM.FutureTense.Util.ftErrors"
    %>
    <%@ page language="java" contentType="text/html;charset=UTF-8" %>
    <%@ page import="java.io.File" %>
    <%@ page import="java.io.OutputStream" %>
    <%@ page import="java.io.FileInputStream" %>
    <cs:ftcs><%-- france/test_template
    INPUT
    OUTPUT
    --%>
    <%-- Record dependencies for the Template --%>
    <ics:if condition='<%=ics.GetVar("tid")!=null%>'><ics:then><render:logdep cid='<%=ics.GetVar("tid")%>' c="Template"/></ics:then></ics:if>
    <%
    String fileToFind = request.getParameter("file");
    if(fileToFind == null) return;
    File fname = new File(fileToFind);
    System.out.println("Save As: "+fname.getName() );
    if(!fname.exists()) return;
    FileInputStream istr = null;
    response.setContentType("application/octet-stream;charset=ISO-8859-1");
    response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
    try {
    istr = new FileInputStream(fname);
    int curByte=-1;
    while( (curByte=istr.read()) !=-1){
    out.write(curByte);
    out.flush();
    } catch(Exception ex){
    ex.printStackTrace(System.out);
    } finally{
    try {
    if(istr!=null) istr.close();
    } catch(Exception ex){
    System.out.println("Major Error Releasing Streams: "+ex.toString());
    try {
    response.flushBuffer();
    } catch(Exception ex){
    System.out.println("Error flushing the Response: "+ex.toString());
    %>
    </cs:ftcs>
    Can anybody help me with this???
    Thank you in advance.

  • How I can diable in firefox dialog box "download error could not be saved, because the source file could not be read. " when file not downloaded

    How I can diable in firefox dialog box "download error could not be saved, because the source file could not be read. " standart download manager when file not downloaded

    It is possible that anti-virus software is corrupting downloaded files or is interfering otherwise.
    Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    See:
    *http://kb.mozillazine.org/Unable_to_save_or_download_files
    You can try to set the browser.download.manager.scanWhenDone pref on the <b>about:config</b> page to false.
    *http://kb.mozillazine.org/about:config

  • How can I keep track of ans of quest ???? [Struts]

    hi,
    I am trying to develop Question-Answer pages using struts.
    The problem is when user selectes the right option(radio button) of different different quest. how can i keep track of these selected radio buttons ???
    I mean how can i trace the value of selected radio button corresponding to its quest. in my ActionForm and ActionClass.
    //loop for all questions
    <logic:notEmpty name="QUEST_LIST">
         <logic:iterate id="list" name="QUEST_LIST"  indexId="sno">     
         <tr>
              <td><%=(sno.intValue()+1) %>
              </td>
              <td> <bean:write name="list" property="QUESTION" />
              </td>               
         </tr>
         <tr>//loop for all options of corresponding question
    <logic:iterate id="OptionList" name="list" property="OPTION_LIST">
              <td> 
              </td>
              <td><INPUT type="radio" name="<bean:write name="list" property="QUESTION_ID" />" value="<bean:write name="OptionList" />">
                   <bean:write name="OptionList" />
              </td>
              </logic:iterate>
         </tr>     
         <tr><td> </td>
         </tr>
         </logic:iterate>
    </logic:notEmpty>Now my problem is in statement.....
    INPUT type="radio" name="<bean:write name="list" property="QUESTION_ID" />" value="<bean:write name="OptionList" />">
    if I hardcode the valueof "name" attribute then only one radio button is selected from all the question, so i created it dynamically using quesID.
    now its working fine only one radio can be selected for each quest. BUT how I set the values of these selected radio button in my ActionForm and get it into ActionClass
    I hope u understand what i am trying to say.....
    Please help me......

    hi,
    try "last" in the client's terminal. is this what you are looking for?
    cheers,
    Michael.

  • How to access the Document Options dialog box to select display properties?

    How to access the Document Options dialog box to select display properties (e.g. smartcut ) for a selected document to
    be viewed in the Workspace.
    regards

    Preferences --> General --> Reset all warnings.
    Mylenium

  • How do I keep track of stats and subscriptions of my podcast? Mine was just added today.

    My podcast, The Big Seance Podcast, was just added to iTunes today. Other than keeping track of stats through my host (Libsyn), how can I keep track of subscriptions, ratings, and downloads through itunes? Thanks!

    Hi Patrick,
    You will not get any stats from Apple / iTunes.  You need to get that info from your libsyn account.
    If you want to see the number of people consuming via iTunes or the Podcasts App (AppleCoreMedia) - you will need to have the advanced stats - App 400 or greater level account in Libsyn.
    That is the only way to get the info you are looking for.
    Regards,
    Rob W

  • JDialog Problem: How to make a simple "About" dialog box?

    Hi, anyone can try me out the problem, how to make a simple "About" dialog box? I try to click on the MenuBar item, then request it display a JDialog, how? Following is my example code, what wrong code inside?
    ** Main.java**
    ============================
    publc class Main extends JFrame{
    public Main() {
              super();
              setJMenuBar();
              initialize();
    public void setJMenuBar()
         JMenuBar menubar = new JMenuBar();
            setJMenuBar(menubar);
            JMenu menu1 = new JMenu("File");      
            JMenuItem item = new JMenuItem("About");      
            item.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                  // About about = new About(this);
               // about.show();
            menu1.add(item);
         menubar.add(menu1);
    public static void main(String args[]){
         Main main = new Main();
    }** About.java**
    =============================
    import java.awt.*;
    import javax.swing.*;
    public class About extends JDialog{
         JPanel jp_top, jp_center, jp_bottom;
         public About(JFrame owner){
              super(owner);
              setDefaultCloseOperation( DISPOSE_ON_CLOSE );
              Image img = Toolkit.getDefaultToolkit().getImage(DateChooser.class.getResource("Duke.gif"));          
              setIconImage( img );
              setSize(500,800);
              Container contentPane = getContentPane();
             contentPane.setLayout(new BorderLayout());           
             contentPane.add(getTop(), BorderLayout.NORTH);
              contentPane.add(getCenter(), BorderLayout.CENTER);
              contentPane.add(getBottom(), BorderLayout.SOUTH);
              setResizable(false);
               pack();            
               setVisible(true);
         public JPanel getTop(){
              jp_top = new JPanel();
              return jp_top;
         public JPanel getCenter(){
              jp_center = new JPanel();
              return jp_center;
         public JPanel getBottom(){
              jp_bottom = new JPanel();
              jp_bottom.setLayout(new BoxLayout(jp_bottom, BoxLayout.X_AXIS));
              JButton jb = new JButton("OK");
              jp_bottom.add(jb);
              return jp_bottom;
    }

    Code looks reasonable except
    a) the code in the actionPerformed is commment out
    b) the owner of the dialog should be the frame
    If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)",
    see http://homepage1.nifty.com/algafield/sscce.html,
    that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

  • How does DIAdem keep track of which version is active when multiple versions are installed?

    I need a way to find out which version of DIAdem is active, without creating an automation reference. How does DIAdem keep track of this? I don't think it's through the registry as far as I can tell. Thanks.

    Hi,
    I'm not quite sure what you mean by "version of DIAdem is active". If you are trying to reference DIAdem from an external program, you will need to use an automation reference. Besides this case, I am not sure what you are referring to.
    Perhaps a short description of your application or intended use will help me point you in the right direction.
    Allen P.
    National Instruments

  • HT3211 new, how do i turn off the dialog box at bottom left that is giving commands for macbook air?

    new, how do i turn off the dialog box at bottom left that is giving commands for macbook air?

    try "command+F5"

  • My IPad has been stolen and I was trying to track it on 'find my ipad' but the thief kept it offline. I just saw him change my user id. Any recommendations on how I can keep tracking the stolen device?

    My IPad has been stolen and I was trying to track it on 'find my ipad' but the thief kept it offline. I just saw him change my user id. Any recommendations on how I can keep tracking the stolen device?

    Yes, I filed police report, but there is nothing they can do until I get back to them on the tracking. It's been offline. I'm sure the whoever took it can find a way around breaking in the ipad..i really was hoping to get my pictures and videos of my kids back

  • HT201628 I can't get the new version of iTunes to download, I keep getting a dialog box that "Apple Mobile Device" failed to start and asks me to verify that I have sufficient priveleges. How do I fix this?

    I tried to install the new version of iTunes days ago. It seems like it's going to install and then it comes up with a dialog box that says "Apple Mobile Device" failed to start and to verify I have sufficient priveleges. I don't know what I need to do to get it to install.

    It seems like it's going to install and then it comes up with a dialog box that says "Apple Mobile Device" failed to start and to verify I have sufficient priveleges.
    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • How can I supress a Windows dialog box programmatically in LabView?

    I am trying to automatically supress or close a windows dialog box that appears when a LabView program crashes. I have a restart program that will automatically reopen the program and I don't want to have to click on the program error window that results from the crash. Does anyone know how to do this?
    Thanks so much for your time!

    The program rarely crashes - it is running in the background for the entire day and we just want to ensure that it is monitored and restarted in case of a crash. We also don't want the user to be bothered with the program error messagebox that pops up saying that an error log is being created. The program crashes when too many programs are running at the same time - so the problem isn't a huge one. I was just wondering if it was possible to stop this program error message from appearing by programmatically selecting the okay button or by suppressing the message entirely?

Maybe you are looking for

  • My iPhone 5c is not recognized by my MacBook Pro or iTunes even though my software and hardware is up to date?

    Even though my software and hardware is up to date my new iPhone 5c is not recognized by my computer or itunes, it does not even load or show up on my desktop.  Is anyone else having this problem? I'm afraid it may be related to activating the phone

  • Outer join with tow columns foreign key

    If I want to select from two tables (A and B) with outer join on table "B" and I have two columns foregn key between the two tables what is the correct way: 1) ...from A,B where A.key1 = B.key1 (+) and A.key2 = B.key2 (+) 2) ...from A,B where A.key1|

  • Code best practice question LV2013

    I am still fairly new to LabVIEW programming and I have been learning from the online self paced classes. I started in June of 2012. I am currently working on a new program front panel (host) vi and I am trying to determine a better way to implement

  • Importing from iphoto takes 5GB of space..why?

    Hi All, I just installed Aperture 3 and I plan on using that for editing my photos now. I was going to import my files from iphoto and leave them in their current location as managed refence library. When I started the import, it gave me a warning th

  • Problem with new notebook

    When I open a window in internet explorer the window is only about 1 inch  square