JOptionPane repeating?

I have a JOptionPane that promts a user for a selection from an array. The problem is that when the user selects one, the JOptionPane pops up again for another choice. How can I get it to only come up once.
Here is my code, thanks
import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import Sequencer.*;
public class DisplayQueryResults extends JFrame {
// java.sql types needed for database processing
private Connection connection;
private Statement statement;
private ResultSet resultSet;
private ResultSetMetaData rsMetaData;
// javax.swing types needed for GUI
private JTable table;
private JScrollPane scroller;
private JTextArea inputQuery;
private JButton submitQuery;
private String query;
public DisplayQueryResults()
super( "Enter Query. Click Submit to See Results." );
// Load the driver to allow connection to the database
     try {
     dbConnection conn = new dbConnection();
     connection = conn.dbConnect("135.86.216.201","test","prod","");
                    getTable();
     } catch ( Exception e) {
     System.out.println("Error detected :"+e);
// If connected to database, set up GUI
inputQuery =
new JTextArea( "SELECT * FROM testresult", 4, 30 );
submitQuery = new JButton( "Submit query" );
submitQuery.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent e )
//getTable();
JPanel topPanel = new JPanel();
topPanel.setLayout( new BorderLayout() );
topPanel.add( new JScrollPane( inputQuery),
BorderLayout.CENTER );
topPanel.add( submitQuery, BorderLayout.SOUTH );
table = new JTable( 4, 4 );
Container c = getContentPane();
c.setLayout( new BorderLayout() );
c.add( topPanel, BorderLayout.NORTH );
c.add( table, BorderLayout.CENTER );
getTable();
setSize( 500, 500 );
show();
private void getTable()
try {
//String query = "select site,testStage,testName,testDate,testerName,slot,cardSerial,cardType,cardRev,result,failureInfo,failureCode,failureSubCode from testresult";
          //String query = "select * from testresult";
          String queries[] = {"View all available data","View Board history","View Yield"};
          Object selquery = JOptionPane.showInputDialog(null,"Please choose a Query...","Query Selection",JOptionPane.QUESTION_MESSAGE,
                                   null, queries, queries[0]);
          if (selquery.toString().equals(queries[1])){
               String sn = JOptionPane.showInputDialog("Please enter board serial number...");
               query = "select site,testStage,testName,testDate,testerName,slot,cardSerial,cardType,cardRev,result,failureInfo,failureCode,failureSubCode from testresult where cardSerial = '"+sn.trim()+"'";
          }else if (selquery.toString().equals(queries[0])){
               query = "select * from testresult";
          }else if (selquery.toString().equals(queries[2])){
               //query = "                                   ";
          }else{}
statement = connection.createStatement();
resultSet = statement.executeQuery( query );
displayResultSet( resultSet );
catch ( SQLException sqlex ) {
sqlex.printStackTrace();
private void displayResultSet( ResultSet rs )
throws SQLException
// position to first record
boolean moreRecords = rs.next();
// If there are no records, display a message
if ( ! moreRecords ) {
JOptionPane.showMessageDialog( this,
"ResultSet contained no records" );
setTitle( "No records to display" );
return;
Vector columnHeads = new Vector();
Vector rows = new Vector();
try {
// get column heads
ResultSetMetaData rsmd = rs.getMetaData();
for ( int i = 1; i <= rsmd.getColumnCount(); ++i )
columnHeads.addElement( rsmd.getColumnName( i ) );
// get row data
do {
rows.addElement( getNextRow( rs, rsmd ) );
} while ( rs.next() );
// display table with ResultSet contents
table = new JTable( rows, columnHeads );
scroller = new JScrollPane( table );
Container c = getContentPane();
c.remove( 1 );
c.add( scroller, BorderLayout.CENTER );
c.validate();
catch ( SQLException sqlex ) {
sqlex.printStackTrace();
private Vector getNextRow( ResultSet rs,
ResultSetMetaData rsmd )
throws SQLException
Vector currentRow = new Vector();
for ( int i = 1; i <=rsmd.getColumnCount(); ++i )
switch( rsmd.getColumnType( i ) ) {
case Types.VARCHAR:
case Types.LONGVARCHAR:
currentRow.addElement( rs.getString( i ) );
break;
case Types.INTEGER:
currentRow.addElement(
new Long( rs.getLong( i ) ) );
break;
default:
System.out.println( "Type was: " +
rsmd.getColumnTypeName( i ) );
return currentRow;
public void shutDown()
try {
connection.close();
catch ( SQLException sqlex ) {
System.err.println( "Unable to disconnect" );
sqlex.printStackTrace();
public static void main( String args[] )
final DisplayQueryResults app =
new DisplayQueryResults();
app.addWindowListener(
new WindowAdapter() {
public void windowClosing( WindowEvent e )
app.shutDown();
System.exit( 0 );
public JTable returnTable(){
     return table;
public JScrollPane returnScrollPane(){
     return scroller;

It's now fixed!!!

Similar Messages

  • Method repeat problem

    Hi guys.
    have some prob with the following, appreciate the help.
    the Main Method is,
    asking the user to input a specific number, if the specific number does not match it repeats the same message input.
    i use the if statement to do this(not to sure whether it is correct,
    i want to use the while loop, but does not know how to put it)
    anyway it did the job BUT when i try to return the value from my method(the method is "square root the input number").
    it will square root the specific input number but does not pops up the input message when the input number is not the specific number.
    i think the problem lies in the if statement on where i put it or i need to use the while loop.
    below is the program.
    statements in bold is the pop up screen
    MAIN METHOD
    Ask user to input the number;
    input=Double.parseDouble(inputStr);
    IF \\ the number match
    double numbered = number(input);
    show values of square root of input  is numbered
    ELSE IF \\ the number is not match
    Ask user to input the number; \\ask the user to input in the specific number again
    METHOD
    public static Double number(double x)
    double squareroot = Math.sqrt(x);
    return squareroot;

    Hi,
    I may be opening up a can of worms here but in the few years I have been learning Java I have never used a do-while loop. Perhaps that is a short-coming of my own but your use of it looks real messy.
    I've taken the code I wrote earlier and have included the message dialogs to show you how to use the YES_OPTION. It works well and is less complicated than your attempt. There is probably a neater solution but hopefully you can take something from this.
    import javax.swing.*;
    public class Checker{
         private int theAnswer;
         public Checker(){
              theAnswer = 1 + (int)(Math.random() * 100); //generate a random number between 1 and 100
                 getInput();
         //Get input as per your earlier code
         private void getInput(){
                 //get the input from the user here;
                 String inputStr;
                int input; 
                inputStr = JOptionPane.showInputDialog (null, "Enter a number between 1 and 100");
                input = Integer.parseInt(inputStr);
                validateInput(input); //now check the input
         private void validateInput(int d){
              //invalid input. Tell the user they have made an error and call getInput() again
                 if(d < 1 || d > 100){
                      JOptionPane.showMessageDialog(null, "Number is not between 1 and 100!", "Input Error!", JOptionPane.ERROR_MESSAGE);
                      getInput();
                 //entry is ok
                 else{
                      //check if the input is the answer
                      if(d == theAnswer)
                      //correct answer given
                      JOptionPane.showMessageDialog(null, "Correct!", "Good guess!", JOptionPane.INFORMATION_MESSAGE);
                      //wrong answer given
                      else{
                           //let user choose whether they want to guess again
                           if(JOptionPane.showConfirmDialog(null,
                             "Wrong answer. Would you like another go?",
                             "Guessing Game",
                             JOptionPane.YES_NO_OPTION,
                             JOptionPane.QUESTION_MESSAGE,
                             null) == JOptionPane.YES_OPTION)
                           getInput(); //call to getInput() again as user has selected yes
                      //if the program has got here either the user has correctly guessed
                      //or the user chose not to guess again.
                      System.exit(0);
         public static void main(String [] args){
              Checker c = new Checker();
    }Regards,
    Chris
    Message was edited by:
    lordflasheart

  • Why won't /t work in JOptionPane?

    Hi I have made a program but for some reason \t won't work so my output is messy in the JOptionPane. What am I doing wrong?
    import javax.swing.JOptionPane;
    class Signal
         public static void main(String[]args)
              //Declare variables
              int sigNo=getInt();
              int SigVal;
              int i,j;
              int [] Signals=new int[sigNo];
              i=0;
              //Repeating the input dialog to collect all the signals
              while (i<sigNo)
                   String SmoothSigValStr=JOptionPane.showInputDialog(null,"Enter in audio signal value",
                   "Signal Smoother",JOptionPane.QUESTION_MESSAGE);
                   //Checking if there is no input
                   if ((SmoothSigValStr==null)||(SmoothSigValStr.length()==0))
                        SmoothSigValStr="0";
                   SigVal=Integer.parseInt(SmoothSigValStr);
                   //Assigning the number to the array
                   Signals=SigVal;
                   i++;
              outputMessage(Signals);
              System.exit(0);
         public static int getInt()
              boolean noError=false;
              int sigNo=0;
              //Making sure that a number greater than 2 is entered
              while (noError==false)
                   String InpStr=JOptionPane.showInputDialog(null,"Enter in number of signals",
                   "Signal Input",JOptionPane.QUESTION_MESSAGE);
                   //Checking if there is no input
                   if ((InpStr==null)||(InpStr.length()==0))
                        InpStr="0";
                   sigNo=Integer.parseInt(InpStr);
                   //Error message if a number less than 2 is entered
                   if (sigNo<2)
                        JOptionPane.showMessageDialog(null,"Enter in a signal number greater than 2",
                        "Error",JOptionPane.ERROR_MESSAGE);
                        noError=false;
                   else
                        noError=true;
              return sigNo;
         public static void outputMessage(int [] Signals)
              int j,SmoothSigVal=0;
              String wholeOutput="Signal \t \t Smooth\n";
              //Producing the output in the DOS window
              for(j=0;j<=(Signals.length-1);j++)
                   if (j==0)
                        System.out.println("Signal\t\tSmooth");
                        SmoothSigVal=((Signals[j+1]+Signals[j])/2);
                   else if (j==(Signals.length-1))
                        SmoothSigVal=((Signals[j]+Signals[j-1])/2);
                   else
                        SmoothSigVal=((Signals[j-1]+Signals[j]+Signals[j+1])/3);
                   //DOS window output
                   System.out.println(+j+" \t\t "+SmoothSigVal);
                   //String for single JOptionPane output message
                   wholeOutput=wholeOutput+j+" \t\t "+SmoothSigVal+"\n";
              output(wholeOutput);
         //Outputting to a single JOptionPane message box
         public static void output(String wholeOut)
              JOptionPane.showMessageDialog(null,wholeOut,"Signal Smoother",
              JOptionPane.INFORMATION_MESSAGE);
              System.exit(0);

    Hello Frind,
    U really made one simple mistake. The escape sequence \t will not work with any type of frames. It works only in console.
    so please replace the following lines with the statements suggested by me or u can use any other techniques
    wholeOutput=wholeOutput+j+"\t\t"+SmoothSigVal+"\n";
    with
    String s=new String(" ");
    wholeOutput=wholeOutput+j+s+SmoothSigVal+"\n";
    Please try some other methods, thats suitable for u.

  • JOptionPane internal messages modality

    Hi,
    I was trying to workaround the fact that modal dialogs and option panes block the entire JVM and not only their parents, so I decided to give JOptionPane.showInternalMessageDialog a try using Java 5.0 (since the modality was broken in JDK 1.4.2_xx).
    If you give the sample below a try, you will notice that displaying an internal message in the primary frame will block the internal frames of both the primary and the secondary frames.
    Is there any way to disable this behavior and reduce the modality scope of the internal message to the desktop pane it belongs to?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class InternalOptionPane {
      public static void displayApplicationWindow(String title) {
        final JFrame appFrame = new JFrame(title);
        appFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        final JDesktopPane desktop = new JDesktopPane();
        final JButton displayMessageBtn = new JButton("Display message");
        ActionListener displayInternalMessageAction = new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            JOptionPane.showInternalMessageDialog(displayMessageBtn,
              "Why am I blocking the internal frames in other desktop pane?",
              "Internal message", JOptionPane.PLAIN_MESSAGE);
        displayMessageBtn.addActionListener(displayInternalMessageAction);          
        JInternalFrame iFrame = new JInternalFrame("Internal Window");
        desktop.add(iFrame);
        Container iContent = iFrame.getContentPane();
        iContent.setLayout(new FlowLayout());
        iContent.add(displayMessageBtn);
        iFrame.setBounds(25, 25, 200, 100);
        iFrame.setVisible(true);
        Container content = appFrame.getContentPane();
        content.add(desktop, BorderLayout.CENTER);
        appFrame.setSize(500, 300);
        appFrame.setVisible(true);
      public static void main(String args[]) {
         displayApplicationWindow("Primary");
         displayApplicationWindow("Secondary");
    }Many Thanks
    Hani

    Hello Jarek,
    >> But when I run it from SQL Plus I see following error: …
    This API must run in the APEX context. You should use a privilege user, or the APEX owner (in this case you don’t need to change the curret_schema parameter). Try the following script as an example:
    declare
      l_ddl  varchar2(100);
    begin
       l_ddl := 'alter session set current_schema="APEX_030200"';
       EXECUTE IMMEDIATE (l_ddl);
       wwv_flow_api.set_security_group_id(apex_util.find_security_group_id('MyWorkspaceName'));
       wwv_flow_api.create_message (
        p_flow_id => '192',
        p_name => 'APEXIR_AGGREGATE',
        p_message_language => 'pl',
        p_message_text => 'Agregacja'
    end;If you are using an earlier version to 3.2, you should set the appropriate schema name to your version. Also, the ‘MyWorkspaceName’ should be replaced with your actual workspace name.
    Bear in mind that the relevant APEX meta data tables include a unique restraint, so you can’t run the script repeatedly, without deleting set messages.
    This is an unsupported action, so please take all the necessary precaution to avoid any problems, like BACKUP, BACKUP and BACKUP.
    >> In general it looks like security bug because I can run this procedure for other applications which do not exist in my workspace.
    This API was meant to be used by the APEX development team only, so maybe its code is not checking all malicious options out there. I’ll draw the attention of Joel, from the development team, to your claim. If it need fixing, I’m sure he will take care of it.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Forthcoming book about APEX: Oracle Application Express 3.2 – The Essentials and More

  • Repeat List Help

    I have a spry region with a select list like so :
    <div spry:region="dsPhones">
    <select name="select" spry:repeatchildren="dsPhones"
    spry:choose="choose"
    onchange="dsPhones.setCurrentRowNumber(this.selectedIndex);" >
    <option spry:when="{ds_RowNumber} ==
    {ds_CurrentRowNumber}" selected="selected">{name}</option>
    <option spry:default="default">{name}</option>
    </select>
    </div>
    The select list works fine until...
    I have another dataset on the page that pulls the phone id
    out of a different table. I am trying to get the select list to
    select the phone id from the other dataset on the page and display
    the name from dsPhones… I can’t figure this out out. I
    tried to make the select list dynamic in the properties instpector
    but it gave me this below and doenst work:
    <div spry:region="dsPhones dsInfo">
    <select name="select" spry:repeatchildren="dsPhones"
    spry:choose="choose"
    onchange="dsPhones.setCurrentRowNumber(this.selectedIndex);EST();"
    >
    <option spry:when="{ds_RowNumber} ==
    {ds_CurrentRowNumber}" selected="selected" value="" <%If (Not
    isNull("{dsInfo::idphone}")) Then If ("" =
    CStr("{dsInfo::idphone}")) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>{name}</option>
    <option spry:default="default" value="" <%If (Not
    isNull("{dsInfo::idphone}")) Then If ("" =
    CStr("{dsInfo::idphone}")) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>{name}</option>
    </select>
    </div>
    can someone help? I can try to clarify better with an example
    if needed.

    Hello,
    you want to check whether the user entered same value twice in the combo-editor, dont you? Then have a look:import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.JTextComponent;
    public class ComboTest extends JFrame implements ActionListener
         private JComboBox combo = null;
         public ComboTest()
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              initCombo();
              pack();
              setLocationRelativeTo(null);
              setVisible(true);
         private void initCombo()
              combo=new JComboBox();
              combo.setEditable(true);
              combo.addActionListener(this);
              getContentPane().add(combo);
         public void actionPerformed(ActionEvent e)
              JTextField editorField = (JTextField) combo.getEditor().getEditorComponent();
              String input = editorField.getText();
              if(input.equals(""))
                   return;
              int count = combo.getItemCount();
              boolean repeat = false;
              for(int i=0; i<count; i++)
                   if(input.equals(combo.getItemAt(i)))
                        repeat = true;
                        break;
              if(repeat)
                   JOptionPane.showMessageDialog(combo,"Do not enter same value twice!");
              else
                   combo.addItem(input);
              editorField.setText("");     
         public static void main(String[]args)
              new ComboTest();
    }regards,
    Tim

  • How can i repeat it?

    The following codes is a product of two number game,but if i want it repeat the game again and user can end the game.how can i do that,please give some suggestion.
    import java.awt.*;
    import javax.swing.*;
    public class Lab10 extends JApplet
    int
    count = 0,
         num1,
    num2,
    getnum,
    numsum;
         String input,
         output;
         public void init()
         num1 = 1 + (int) (Math.random() * 9);
         num2 = 1 + (int) (Math.random() * 9);
         input = JOptionPane.showInputDialog(" What is the product of " + num1 + " and " + num2 + "." );
         getnum = Integer.parseInt(input);
         public void paint( Graphics g )
         super.paint( g );
         if (getnum == num1 * num2)
         g.drawString( "Good work", 25, 25 );
         else
         g.drawString( "Try again", 25, 25 );
    }     

    wantToContinue = true
    while (wantToContinue)
      begin while
        print "Do you want to continue : "
        read userInput
        if userInput == 'n'
           wantToContinue = false
      end whilethis is a simple pseudocode to implement your question. try to convert
    this to java code.

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

  • Repeating a group element on each page of a report.

    I have a report where I need to repeat a group element on each page. The element is from the first group in the data. It is in the center group. Currently, the values from this group only print when the group changes. Everything I try does not work. Does anyone have any ideas. I am attaching a sample of the data. Along with the rtf document. I am using the BI Publisher plug in in Word to create the template.
    Data
    <?xml version="1.0" encoding="UTF-8"?>
    <POLLEDTICKETRPT>
    <USERCD>klockhar</USERCD><POLLDATE>03/24/2009</POLLDATE>
    <LIST_CENTER>
    <CENTER>
    <CENTER_CD>0039</CENTER_CD>
    <CENTER_NAME>CROSS PLAINS QUARRY</CENTER_NAME>
    <LIST_TRANSDATE>
    <TRANSDATE>
    <TRANS_DATE>03/11/2009</TRANS_DATE>
    <LIST_CUSTOMER>
    <CUSTOMER>
    <CUSTOMER_NBR>33221477</CUSTOMER_NBR>
    <CUST_NAME>TDOT DISTRICT 32-GALLATIN</CUST_NAME>
    <LIST_JOB>
    <JOB>
    <JOB_CUST>33221477</JOB_CUST>
    <JOB_CUST_NAME>TDOT DISTRICT 32-GALLATIN</JOB_CUST_NAME>
    <RGI_JOB_NBR>2008</RGI_JOB_NBR>
    <QUOTE_ID>0</QUOTE_ID>
    <LIST_COSTCODE>
    <COSTCODE>
    <COSTCODING/>
    <COST_CNTR/>
    <COST_ACCT/>
    <PROJECT_NBR/>
    <PROJECT_TASK/>
    <LIST_TICKET>
    <TICKET>
    <TICKET_NBR>5000021</TICKET_NBR>
    <ORIGIN_CD>TSCC</ORIGIN_CD>
    <REFERENCE_NBR>254510</REFERENCE_NBR>
    <VOID_IND>N</VOID_IND>
    <STATE_CD>TN</STATE_CD>
    <MEASURE_SYSTEM>S</MEASURE_SYSTEM>
    <LOCATION>THANK YOU</LOCATION>
    <PO_NBR>POS-254510-C</PO_NBR>
    <TAX_CODE>4</TAX_CODE>
    <PRODUCT_CD>000003</PRODUCT_CD>
    <HAUL_ZONE_CD/>
    <INVENTORY_STATUS>PR</INVENTORY_STATUS>
    <HAULER_NBR/>
    <RGI_TRANSPORT_CD>FU96</RGI_TRANSPORT_CD>
    <HAUL_RATE> .00</HAUL_RATE>
    <MAT_RATE> 8.50</MAT_RATE>
    <NET_TONS> -7.96</NET_TONS>
    <MAT_SALES_AMT> -67.66</MAT_SALES_AMT>
    <HAUL_AMT>0</HAUL_AMT>
    <TAX_AMT>0</TAX_AMT>
    <SEV_TAX_AMT>0</SEV_TAX_AMT>
    <SEV_TAX_IND>N</SEV_TAX_IND>
    <VALID_NET_TONS> -7.96</VALID_NET_TONS>
    <VALID_SALES_AMT> -67.66</VALID_SALES_AMT>
    <VALID_HAUL_AMT> .00</VALID_HAUL_AMT>
    <VALID_TAX_AMT> .00</VALID_TAX_AMT>
    <VALID_SEV_TAX_AMT> .00</VALID_SEV_TAX_AMT>
    <CASH_TONS> .00</CASH_TONS>
    <CASH_SALES_AMT> .00</CASH_SALES_AMT>
    <CASH_TAX_AMT> .00</CASH_TAX_AMT>
    <CASH_SEVTAX_AMT> .00</CASH_SEVTAX_AMT>
    <CASH_HAUL_AMT> .00</CASH_HAUL_AMT>
    <TRADE_TONS> -7.96</TRADE_TONS>
    <TRADE_SALES_AMT> -67.66</TRADE_SALES_AMT>
    <TRADE_TAX_AMT> .00</TRADE_TAX_AMT>
    <TRADE_SEVTAX_AMT> .00</TRADE_SEVTAX_AMT>
    <TRADE_HAUL_AMT> .00</TRADE_HAUL_AMT>
    <INTRA_TONS> .00</INTRA_TONS>
    <INTRA_SALES_AMT> .00</INTRA_SALES_AMT>
    <INTRA_TAX_AMT> .00</INTRA_TAX_AMT>
    <INTRA_SEVTAX_AMT> .00</INTRA_SEVTAX_AMT>
    <INTRA_HAUL_AMT> .00</INTRA_HAUL_AMT>
    <INTER_TONS> .00</INTER_TONS>
    <INTER_SALES_AMT> .00</INTER_SALES_AMT>
    <INTER_TAX_AMT> .00</INTER_TAX_AMT>
    <INTER_SEVTAX_AMT> .00</INTER_SEVTAX_AMT>
    <INTER_HAUL_AMT> .00</INTER_HAUL_AMT>
    <CASH_PR_TONS> .00</CASH_PR_TONS>
    <CASH_NP_TONS> .00</CASH_NP_TONS>
    <CASH_MI_TONS> .00</CASH_MI_TONS>
    <TRADE_PR_TONS> -7.96</TRADE_PR_TONS>
    <TRADE_NP_TONS> .00</TRADE_NP_TONS>
    <TRADE_MI_TONS> .00</TRADE_MI_TONS>
    <INTER_PR_TONS> .00</INTER_PR_TONS>
    <INTER_NP_TONS> .00</INTER_NP_TONS>
    <INTER_MI_TONS> .00</INTER_MI_TONS>
    <INTRA_PR_TONS> .00</INTRA_PR_TONS>
    <INTRA_NP_TONS> .00</INTRA_NP_TONS>
    <INTRA_MI_TONS> .00</INTRA_MI_TONS>
    </TICKET>
    </LIST_TICKET>
    </COSTCODE>
    </LIST_COSTCODE>
    </JOB>
    </LIST_JOB>
    </CUSTOMER>
    </LIST_CUSTOMER>
    </TRANSDATE>
    RTF Template
    DISPLAY CENTER
    S M
    FOR EACH CENTER
    SET CENTER
    CENTER: CENTER_CD CENTER_NAME
    FOR EACH TRANSDATE
    TRANSACTION DATE: TRANS_DATE
    FOR EACH CUSTOMER
    FOR EACH JOB
    Customer: JOB_CUST JOB_CUST_NAME
    Job: RGI_JOB_NBR Quote Id: QUOTE_ID
    FCC
    group COSTCODE by COSTCODING
    Cost Center: COST_CNTR Cost Acct: COST_ACCT Project: PROJECT_NBR Task: PROJECT_TASK
    Ticket Nbr     ORGCD     OrigTck     V     ST     Location     Po Nbr     Tax Cd     Prod Code     ZN     Hauler      Truck     Haul Rate     UnitPrice     Tons     SalesAmount
    F TCK#M     CODE     OTCK#     V     ST     LOCATION     PO_NBR      TC     PROD     HZ     HAULER     TRUCK     0.00     0.00     0.00 *      0.00 E

    Post Author: Guy
    CA Forum: General
    Hi,
    You should add a first level of grouping in your subreport on a fake formula field with a constant value.  Put your header and footer information in this group header and footer.  In the group option make sure to check the "repeat group header on each page option".
    This group will act as a page header + footer within your subreport.
    good luck!
    Guy

  • XML INVOICE Report RAXINV, Taxline is repeating for each invoice line

    Hi Tim
    Thanks a lot for your blog
    Greeting !!
    I have successfully created XML report for AR invoice Printing learning from your blog but stuck to a problem , whenever Invoice is having multiple lines ,say 20, then for each invoice line there is tax line printing 20 times like this:
    PART NO.| CUSTOMER PART#/DESCRIPTION | UNIT PRICE | QUNTITY|
    A123 | 34 WELD-ROD | 52 | 22 |
    Tax Exempt @ 0.00
    A234 | 238-AL WIER | 63 | 55 |
    Tax Exempt @ 0.00
    ........ Assume there are 20 lines then tax line also repeating 20 times which i don't want .It should get printed only once if it is same
    pls help me to achieve this
    Thanks
    Rahul

    Thanks Tim for Your Instant reply.
    I have gone through your duplicate line elimination but my requirement is not this
    I'll explain it, I am using LINE_DESCRIPTION tag for printing item description and this tag have two value for it, when the LINE_TYPE =LINE then LINE_DESCRIPTION tag is printing the line description and if LINE_TYPE =TAX
    then LINE_DESCRIPTION tag is printing the taxline information. Now if I have 20 lines in Invoice then the tax line will also repeat for 20 times, and if i use duplicate line elimination logic and I have same item it'll not print that item, some times whole invoice become blank.
    So I want to print 20 lines and out of that 15 lines are have same tax rate then it should print once at the end of 15th line and for remaining 5 lines if tax rate is different for each line then it should print at the end of each line (5lines)
    In the linetreevariable i used <xsl:variable xdofo:ctx="incontext" name="invLines" select=".//G_LINES [LINE_TYPE!='FREIGHT']"/> i.e. I want only line type=LINE and TAX
    Thanks
    Rahul

  • [bdb bug]repeatly open and close db may cause memory leak

    my test code is very simple :
    char *filename = "xxx.db";
    char *dbname = "xxx";
    for( ; ;)
    DB *dbp;
    DB_TXN *txnp;
    db_create(&dbp,dbenvp, 0);
    dbenvp->txn_begin(dbenvp, NULL, &txnp, 0);
    ret = dbp->open(dbp, txnp, filename, dbname, DB_BTREE, DB_CREATE, 0);
    if(ret != 0)
    printf("failed to open db:%s\n",db_strerror(ret));
    return 0;
    txnp->commit(txnp, 0);
    dbp->close(dbp, DB_NOSYNC);
    I try to run my test program for a long time opening and closing db repeatly, then use the PS command and find the RSS is increasing slowly:
    ps -va
    PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
    1986 pts/0 S 0:00 466 588 4999 980 0.3 -bash
    2615 pts/0 R 0:01 588 2 5141 2500 0.9 ./test
    after a few minutes:
    ps -va
    PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
    1986 pts/0 S 0:00 473 588 4999 976 0.3 -bash
    2615 pts/0 R 30:02 689 2 156561 117892 46.2 ./test
    I had read bdb's source code before, so i tried to debug it for about a week and found something like a bug:
    If open a db with both filename and dbname, bdb will open a db handle for master db and a db handle for subdb,
    both of the two handle will get an fileid by a internal api called __dbreg_get_id, however, just the subdb's id will be
    return to bdb's log region by calling __dbreg_pop_id. It leads to a id leak if I tried to open and close the db
    repeatly, as a result, __dbreg_add_dbentry will call realloc repeatly to enlarge the dbentry area, this seens to be
    the reason for RSS increasing.
    Is it not a BUG?
    sorry for my pool english :)
    Edited by: user9222236 on 2010-2-25 下午10:38

    I have tested my program using Oracle Berkeley DB release 4.8.26 and 4.7.25 in redhat 9.0 (Kernel 2.4.20-8smp on an i686) and AIX Version 5.
    The problem is easy to be reproduced by calling the open method of db handle with both filename and dbname being specified and calling the close method.
    My program is very simple:
    #include <stdlib.h>
    #include <stdio.h>
    #include <sys/time.h>
    #include "db.h"
    int main(int argc, char * argv[])
    int ret, count;
    DB_ENV *dbenvp;
    char * filename = "test.dbf";
    char * dbname = "test";
    db_env_create(&dbenvp, 0);
    dbenvp->open(dbenvp, "/home/bdb/code/test/env",DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_INIT_MPOOL, 0);
    for(count = 0 ; count < 10000000 ; count++)
    DB *dbp;
    DB_TXN *txnp;
    db_create(&dbp,dbenvp, 0);
    dbenvp->txn_begin(dbenvp, NULL, &txnp, 0);
    ret = dbp->open(dbp, txnp, filename, dbname, DB_BTREE, DB_CREATE, 0);
    if(ret != 0)
    printf("failed to open db:%s\n",db_strerror(ret));
    return 0;
    txnp->commit(txnp, 0);
    dbp->close(dbp, DB_NOSYNC);
    dbenvp->close(dbenvp, 0);
    return 0;
    DB_CONFIG is like below:
    set_cachesize 0 20000 0
    set_flags db_auto_commit
    set_flags db_txn_nosync
    set_flags db_log_inmemory
    set_lk_detect db_lock_minlocks
    Edited by: user9222236 on 2010-2-28 下午5:42
    Edited by: user9222236 on 2010-2-28 下午5:45

  • Repeated Timeouts and "Lost" Interruptus

    Hello,
    At the risk of repeating an often-asked question, has anyone noticed particularly bad download speeds over the last two days? I have been attempting to download a single standard-definition episode of a TV show over a total of approximately seven hours. I've ruled out network problems; I am on a good DSL line and can download from other sources without difficulty. I have also been able to download much larger files from iTunes in a fraction of the time.
    Thanks...
    Benjamin Haag
    http://www.cbenjaminhaag.com

    Oh, and don't even get me started on SEARCH for text within a message. This has never worked, from Day One.
    All I ever get is "We were unable to perform your request. Please try again." SEARCH on header text, like Sender and Subject works fine, but apparently Verizon QA has never tested the other options on large mail inboxes.
    I'm pretty forgiving and undersrtanding of minor glitches and shortcomings in software, but Verizon Webmail is one of the most unreliable utilities that I've ever encountered from a large company with a huge customer base.

  • How can I delete repeats in my iPhoto library without going one at a time?

    I have been trying to clean up my iphoto library, and find that many of my imports have been repeated in different places. Is there a way to clean out repeat photos so there aren't so many of the same ones without having to do so one at a time?

    You can use any one of these applications to identify and remove duplicate photos from an iPhoto Library:
    iPhoto Library Manager - $29.95
    Duplicate Cleaner for iPhoto - free - was able to recognize the duplicated HDR and normal files from an iPhone shooting in HDR. 
    Duplicate Annihilator - $7.95 - only app able to detect duplicate thumbnail files or faces files when an iPhoto 8 or earlier library has been imported into another.
    PhotoSweeper - $9.95 - This app can search by comparing the image's bitmaps or histograms thus finding duplicates with different file names and dates.
    PhotoDedupo  - $4.99 (App Store) - this app has a "similar" search feature which is like PhotoSweeper's bitmap comparison.  It found all duplicates.
    DeCloner - $19.95 - can find dupicates in iPhoto Libraries or in folders on the HD.
    Some users have reported that PhotoSweeper did the best in finding all of the dups in their library: i photo has duplicated many photos, how...: Apple Support Communities.
    If you have an iPhone and have it set to keep the normal photo when shooting HDR photos the two image files that are created will be duplicates in a manner of speaking (same image) but the only diplicate finder app that detected the iPhone HDR and normal photos as being duplicates was PhotoSweeper.  None of the other apps detected those two files as being duplicates as they look for file name as well as other attributes and the two files from the iPhone have diffferent file names.
    iPLM, however, is the best all around iPhoto utility as it can do so much more than just find duplicates.  IMO it's a must have tool if using iPhoto.
    OT

  • How can I repeat a for loop, once it's terms has been fulfilled???

    Well.. I've posted 2 different exceptions about this game today, but I managed to fix them all by myself, but now I'm facing another problem, which is NOT an error, but just a regular question.. HOW CAN I REPEAT A FOR LOOP ONCE IT HAS FULFILLED IT'S TERMS OF RUNNING?!
    I've been trying many different things, AND, the 'continue' statement too, and I honestly think that what it takes IS a continue statement, BUT I don't know how to use it so that it does what I want it too.. -.-'
    Anyway.. Enought chit-chat. I have a nice functional game running that maximum allows 3 apples in the air in the same time.. But now my question is: How can I make it create 3 more appels once the 3 first onces has either been catched or fallen out the screen..?
    Here's my COMPLETE sourcecode, so if you know just a little bit of Java you should be able to figure it out, and hopefully you'll be able to tell me what to do now, to make it repeat my for loop:
    Main.java:
    import java.applet.*;
    import java.awt.*;
    @SuppressWarnings("serial")
    public class Main extends Applet implements Runnable
         private Image buffering_image;
         private Graphics buffering_graphics;
         private int max_apples = 3;
         private int score = 0;
         private GameObject player;
         private GameObject[] apple = new GameObject[max_apples];
         private boolean move_left = false;
         private boolean move_right = false;
        public void init()
            load_content();
            setBackground(Color.BLACK);
         public void run()
              while(true)
                   if(move_left)
                        player.player_x -= player.movement_speed;
                   else if(move_right)
                        player.player_x += player.movement_speed;
                   for(int i = 0; i < max_apples; i++)
                       apple.apple_y += apple[i].falling_speed;
                   repaint();
                   prevent();
                   collision();
              try
              Thread.sleep(20);
              catch(InterruptedException ie)
              System.out.println(ie);
         private void prevent()
              if(player.player_x <= 0)
              player.player_x = 0;     
              else if(player.player_x >= 925)
              player.player_x = 925;     
         private void load_content()
         MediaTracker media = new MediaTracker(this);
         player = new GameObject(getImage(getCodeBase(), "Sprites/player.gif"));
         media.addImage(player.sprite, 0);
         for(int i = 0; i < max_apples; i++)
         apple[i] = new GameObject(getImage(getCodeBase(), "Sprites/apple.jpg"));
         try
         media.waitForAll();     
         catch(Exception e)
              System.out.println(e);
         public boolean collision()
              for(int i = 0; i < max_apples; i++)
              Rectangle apple_rect = new Rectangle(apple[i].apple_x, apple[i].apple_y,
    apple[i].sprite.getWidth(this),
    apple[i].sprite.getHeight(this));
              Rectangle player_rect = new Rectangle(player.player_x, player.player_y,
    player.sprite.getWidth(this),
    player.sprite.getHeight(this));
              if(apple_rect.intersects(player_rect))
                   if(apple[i].alive)
                   score++;
                   apple[i].alive = false;
                   if(!apple[i].alive)
                   apple[i].alive = false;     
         return true;
    public void update(Graphics g)
    if(buffering_image == null)
    buffering_image = createImage(getSize().width, getSize().height);
    buffering_graphics = buffering_image.getGraphics();
    buffering_graphics.setColor(getBackground());
    buffering_graphics.fillRect(0, 0, getSize().width, getSize().height);
    buffering_graphics.setColor(getForeground());
    paint(buffering_graphics);
    g.drawImage(buffering_image, 0, 0, this);
    public boolean keyDown(Event e, int i)
         i = e.key;
    if(i == 1006)
    move_left = true;
    else if(i == 1007)
         move_right = true;
              return true;     
    public boolean keyUp(Event e, int i)
         i = e.key;
    if(i == 1006)
    move_left = false;
    else if(i == 1007)
         move_right = false;
    return true;
    public void paint(Graphics g)
    g.drawImage(player.sprite, player.player_x, player.player_y, this);
    for(int i = 0; i < max_apples; i++)
         if(apple[i].alive)
              g.drawImage(apple[i].sprite, apple[i].apple_x, apple[i].apple_y, this);
    g.setColor(Color.RED);
    g.drawString("Score: " + score, 425, 100);
    public void start()
    Thread thread = new Thread(this);
    thread.start();
    @SuppressWarnings("deprecation")
         public void stop()
         Thread thread = new Thread(this);
    thread.stop();
    GameObject.java:import java.awt.*;
    import java.util.*;
    public class GameObject
    public Image sprite;
    public Random random = new Random();
    public int player_x;
    public int player_y;
    public int movement_speed = 15;
    public int falling_speed;
    public int apple_x;
    public int apple_y;
    public boolean alive;
    public GameObject(Image loaded_image)
         player_x = 425;
         player_y = 725;
         sprite = loaded_image;
         falling_speed = random.nextInt(10) + 1;
         apple_x = random.nextInt(920) + 1;
         apple_y = random.nextInt(100) + 1;
         alive = true;
    And now all I need is you to answer my question! =)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    package forums;
    import java.util.Random;
    import javax.swing.Timer;
    import javax.imageio.ImageIO;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class VimsiesRetardedAppleGamePanel extends JPanel implements KeyListener
      private static final long serialVersionUID = 1L;
      private static final int WIDTH = 800;
      private static final int HEIGHT = 600;
      private static final int MAX_APPLES = 3;
      private static final Random RANDOM = new Random();
      private int score = 0;
      private Player player;
      private Apple[] apples = new Apple[MAX_APPLES];
      private boolean moveLeft = false;
      private boolean moveRight = false;
      abstract class Sprite
        public final Image image;
        public int x;
        public int y;
        public boolean isAlive = true;
        public Sprite(String imageFilename, int x, int y) {
          try {
            this.image = ImageIO.read(new File(imageFilename));
          } catch (IOException e) {
            e.printStackTrace();
            throw new RuntimeException("Bailing out: Can't load images!");
          this.x = x;
          this.y = y;
          this.isAlive = true;
        public Rectangle getRectangle() {
          return new Rectangle(x, y, image.getWidth(null), image.getHeight(null));
      class Player extends Sprite
        public static final int SPEED = 15;
        public Player() {
          super("C:/Java/home/src/images/player.jpg", WIDTH/2, 0);
          y = HEIGHT-image.getHeight(null)-30;
      class Apple extends Sprite
        public int fallingSpeed;
        public Apple() {
          super("C:/Java/home/src/images/apple.jpg", 0, 0);
          reset();
        public void reset() {
          this.x = RANDOM.nextInt(WIDTH-image.getWidth(null));
          this.y = RANDOM.nextInt(300);
          this.fallingSpeed = RANDOM.nextInt(8) + 3;
          this.isAlive = true;
      private final Timer timer = new Timer(200,
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            repaint();
      public VimsiesRetardedAppleGamePanel() {
        this.player = new Player();
        for(int i=0; i<MAX_APPLES; i++) {
          apples[i] = new Apple();
        setBackground(Color.BLACK);
        setFocusable(true); // required to generate key listener events.
        addKeyListener(this);
        timer.setInitialDelay(1000);
        timer.start();
      public void keyPressed(KeyEvent e)  {
        if (e.getKeyCode() == e.VK_LEFT) {
          moveLeft = true;
          moveRight = false;
        } else if (e.getKeyCode() == e.VK_RIGHT) {
          moveRight = true;
          moveLeft = false;
      public void keyReleased(KeyEvent e) {
        moveRight = false;
        moveLeft = false;
      public void keyTyped(KeyEvent e) {
        // do nothing
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        //System.err.println("DEBUG: moveLeft="+moveLeft+", moveRight="+moveRight);
        if ( moveLeft ) {
          player.x -= player.SPEED;
          if (player.x < 0) {
            player.x = 0;
        } else if ( moveRight ) {
          player.x += player.SPEED;
          if (player.x > getWidth()) {
            player.x = getWidth();
        //System.err.println("DEBUG: player.x="+player.x);
        Rectangle playerRect = player.getRectangle();
        for ( Apple apple : apples ) {
          apple.y += apple.fallingSpeed;
          Rectangle appleRect = apple.getRectangle();
          if ( appleRect.intersects(playerRect) ) {
            if ( apple.isAlive ) {
              score++;
              apple.isAlive = false;
        g.drawImage(player.image, player.x, player.y, this);
        for( Apple apple : apples ) {
          if ( apple.isAlive ) {
            g.drawImage(apple.image, apple.x, apple.y, this);
        g.setColor(Color.RED);
        g.drawString("Score: " + score, WIDTH/2-30, 10);
      private static void createAndShowGUI() {
        JFrame frame = new JFrame("Vimsies Retarded Apple Game");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(new VimsiesRetardedAppleGamePanel());
        frame.pack();
        frame.setSize(WIDTH, HEIGHT);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args) {
        SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              createAndShowGUI();
    }Hey Vimsie, try resetting a dead apple and see what happens.

  • Can I switch calendars (Ex. "night shift" to "day shift" cal) with a repeating event, but ONLY for that one event??  It asks "for all events or only this event" if i change the time.  But it changes ALL events when i try and switch calendars.  Any help??

    I have 2 calendars set up for my work schedule, a "night shift" and "day shift" calendar.  I've set up repeating events fro Fri/Sat/Sun 3-11pm "night shifts" and Mon/Tues 7am-3pm "day shifts".  But lets say for example that I swap shifts and instead of working nights on Saturday like I normally would, I am now working days.  I want to change that in my calendar.  When I go to change the event, if i change the TIME it asks if i want to change all event or ONLY this event.  no problem....just this single event.  but when i go to change the event from the "night shift" calendar to the "day shift" calendar, it changes ALL the repeating events, and not just that one single event.   can anyone help with this???  am i doing something wrong?  is there a way to do this or not with the new iCal program???  i used to do this and never had any problems.    Thank you!

    You need to follow iPhoto terms since we only know what you tell us
    what are you calling folders - in iPhoto folders can not hold photos - albums hold photos and folders hold albums or other folders
    The basic default view of photo is by event (iPhoto '08 and later)
    Exactly what you you trying to do?
    LN

  • High school block schedule repeating events

    I'm a high school teacher looking forward to the upcoming fall schedule. I teach at a school where even period and odd period classes are taught on alternate days and I teach only odd schedule classes. So, one week the class is taught on Mon, Wed, Fri and the next week it is Tu and Th except for weeks that have holidays. What is the best way to use repeating events and make up the schedule for this semester (ending 1/28/08 so I also know at a glance what days I'm available to substitute for other instructors?

    I'm a high school teacher looking forward to the upcoming fall schedule. I teach at a school where even period and odd period classes are taught on alternate days and I teach only odd schedule classes. So, one week the class is taught on Mon, Wed, Fri and the next week it is Tu and Th except for weeks that have holidays. What is the best way to use repeating events and make up the schedule for this semester (ending 1/28/08 so I also know at a glance what days I'm available to substitute for other instructors?

Maybe you are looking for

  • Workflow to change item/file permissions using a people column on the List/Library?

    SharePoint 2013 Online. I have a Document library with users that can only add new items permission by default. There is a new people column in that library I presume I can manually change perimssions on one item/file to let a user have full control

  • Steps involved in creating an online SHOPPING BASKET / CART

    I am trying to learn how to create a website for selling products online, and I have no idea where to start with the details of adding a shopping cart to a site etc. All I know (I think) is that SSL Certificates are required for the secure page where

  • Nik Silver Efex Pro 2 not recognized in PS CS6

    hi I'm having problems with Silver Efex Pro 2 after upgrading to PS CS6, worked fine in older versions of PS.. Downloaded the latest installer from Nik Software.. The installer only find my Lightroom 4.1 when installing, and I have to add CS6 manuall

  • How do I keep the colors from inverting when I open the iCloud panel?

    I recently upgraded my 2007 dell Inspiron 1520 from windows XP pro, to windows 7 pro. I installed the iCloud panel, & it seems to operate, but I can't figure why the colors invert? When I click on the iCloud panel, the computer seems to switch to ano

  • I locked my ipad air

    i locked my ipad air with a passcode and i dont remember what it is. what do i need to do to get on my ipad air again?