Please Help Me, Delete Method(any suggestions!!)

Can anyone spare the time to look at the below three classes and suggest a method that goes into the customerList class and deletes a record from the Oracle DB they are sitting on top of.
For example when the deleteCust button is pressed on the form (customerForm) I would like it to delete the current customer (currentCustomer) that is displayed on the form at the time of the button click.
Can anyone please HELP me, it would be very much appreciated :-)
customer class
import java.util.*;
import java.sql.*;
public class Customer{
private int customer_id;
private String customer_name;
private String address1;
private String address2;
private String town;
private String county;
private String post_code;
private String country;
private String fax;
private String telephone;
private String contact_name;
private String email;
private boolean newCustomer;
//private JobList jobList;
public Customer(int c){
customer_id = c;
newCustomer = true;
public Customer(int inCustomer_id,String inCustomer_name,String inAddress1, String inAddress2, String inTown, String inCounty,String inPost_code,String inCountry,String inFax,String inTelephone,String inContact_name,String inEmail){
customer_id=inCustomer_id;
customer_name=inCustomer_name;
address1=inAddress1;
address2=inAddress2;
town=inTown;
county=inCounty;
post_code=inPost_code;
country=inCountry;
fax=inFax;
telephone=inTelephone;
contact_name=inContact_name;
email=inEmail;
newCustomer = false;
public String getAddress1(){
if (address1 == null)
return ("");
else
return address1;
public String getAddress2(){
if (address2 == null)
return ("");
else
return address2;
public String getCounty(){
if (county == null)
return ("");
else
return county;
public String getFax(){
if (fax == null)
return ("");
else
return fax;
public int getCustomer_id(){
if (customer_id == 0)
return (0);
else
return customer_id;
public String getCustomer_name(){
if (customer_name == null)
return ("");
else
return customer_name;
public String getTelephone(){
if (telephone == null)
return ("");
else
return telephone;
public String getPost_code(){
if (post_code == null)
return ("");
else
return post_code;
public String getTown(){
if (town == null)
return ("");
else
return town;
public String getCountry(){
if (country == null)
return ("");
else
return country;
public String getContact_name(){
if (contact_name == null)
return ("");
else
return contact_name;
public String getEmail(){
if (email == null)
return ("");
else
return email;
/*public JobList getJobList() throws SQLException {
// if the joblist object exists return it otherwise create it
if (jobList != null){
return jobList;
else{
return new JobList(this);
public boolean isNewCustomer(){
return newCustomer;
public void setAddress1(String inAddress1){
address1=inAddress1;
public void setAddress2(String inAddress2){
address2=inAddress2;
public void setCounty(String inCounty){
county=inCounty;
public void setFax(String inFax){
fax=inFax;
public void setCustomer_id(int inCustomer_id){
customer_id = inCustomer_id;
public void setCustomer_name(String inCustomer_name){
customer_name=inCustomer_name;
public void setTelephone(String inTelephone){
telephone=inTelephone;
public void setPost_code(String inPost_code){
post_code=inPost_code;
public void setTown(String inTown){
town=inTown;
public void setCountry(String inCountry){
country=inCountry;
public void setContact_name(String inContact_name){
contact_name=inContact_name;
public void setEmail(String inEmail){
email=inEmail;
customerList class
import java.sql.*;
import java.util.*;
public class CustomerList{
private ResultSet rs ;
private Connection con;
private Statement stmt;
public CustomerList () {
ConnectionManager man = ConnectionManager.getInstance();
con = man.getConnection();
public Customer getFirstCustomer()throws SQLException {
Customer firstCustomer;
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
rs = stmt.executeQuery("select customer_id,customer_name,address1,address2,town,county,post_code,country,fax,telephone,contact_name,email from customer");
rs.next();
firstCustomer = loadCustomer();
return firstCustomer;
public Customer getLastCustomer() throws SQLException{
Customer lastCustomer;
rs.last();
lastCustomer = loadCustomer();
return lastCustomer;
public Customer getNextCustomer()throws SQLException{
Customer nextCustomer ;
if (rs.next()){
nextCustomer = loadCustomer();
else{
nextCustomer = null;
return nextCustomer;
public Customer getPreviousCustomer()throws SQLException{
Customer previousCustomer;
if (rs.previous()){
previousCustomer = loadCustomer();
else
previousCustomer = null;
return previousCustomer;
public Customer findCustomer(int inCustNum) throws SQLException{
Customer foundCust;
if (inCustNum==0){
foundCust = getFirstCustomer();
else{
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
rs = stmt.executeQuery("select customer_id,customer_name,address1,address2,town,county,post_code,country,fax,telephone,contact_name,email from customer where customer_id = "+inCustNum);
if (rs.next()){
foundCust = loadCustomer();
else
foundCust = null;
return foundCust;
public Customer addCust()throws SQLException{
Statement stmt2 = con.createStatement();
ResultSet rsadd = stmt2.executeQuery("select custid.nextval from dual");
rsadd.next();
int id = rsadd.getInt("nextval");
rsadd.close();
stmt2.close();
Customer newCust = new Customer(id);
return newCust;
public Customer saveCustomer(Customer inSaveCust)throws SQLException{
Statement stmt3 = con.createStatement();
int rowNum;
//int incid = inSaveCust.getCid();
if (inSaveCust.isNewCustomer()){
stmt3.executeUpdate("insert into customer values ("
+inSaveCust.getCustomer_id()
+",'"+inSaveCust.getCustomer_name()
+"','"+inSaveCust.getAddress1()
+"','"+inSaveCust.getAddress2()
+"','"+ inSaveCust.getTown()
+"','"+ inSaveCust.getCounty()
+"','"+inSaveCust.getPost_code()
+"','"+inSaveCust.getCountry()
+"','"+inSaveCust.getFax()
+"','"+ inSaveCust.getTelephone()
+"','"+inSaveCust.getContact_name()
+"','"+inSaveCust.getEmail()+"')");
inSaveCust = getFirstCustomer();//refreshes list after insert
inSaveCust = getLastCustomer();// goes to the inserted record ie last one
else {
rowNum = rs.getRow();//traps the record number so can be returned to
stmt3.executeUpdate("update customer set customer_name = '"+inSaveCust.getCustomer_name()
+ "', address1 = '"+inSaveCust.getAddress1()
+ "', address2 = '"+inSaveCust.getAddress2()
+ "', town = '"+ inSaveCust.getTown()
+ "', county = '"+ inSaveCust.getCounty()
+ "', post_code = '"+inSaveCust.getPost_code()
+ "', telephone = '"+inSaveCust.getCountry()
+ "', fax = '"+inSaveCust.getFax()
+ "', country = '"+inSaveCust.getTelephone()
+ "', contact_name = '"+inSaveCust.getContact_name()
+ "', email = '"+inSaveCust.getEmail()
+"' where customer_id = "+inSaveCust.getCustomer_id());
inSaveCust = getFirstCustomer();
rs.absolute(rowNum); // points back to same record number as updated
inSaveCust = loadCustomer();
con.commit();
return inSaveCust;
//Trying to add in the delete method here(as u can see it is not working)
/*public Customer deleteCustomer() throws SQL Exception {
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
rs = stmt4.executeQuery("delete from customer where customer_id = "Integer.parseInt(textCustomer_id.getText()));
rs.next();
firstCustomer = loadCustomer();
return firstCustomer;
public boolean isFirst() throws SQLException{
return rs.isFirst();
public boolean isLast() throws SQLException{
return rs.isLast();
public Customer loadCustomer ()throws SQLException{
Customer cust = new Customer(rs.getInt("customer_id"),rs.getString("customer_name"),rs.getString("address1"),
rs.getString("address2"),rs.getString("town"),rs.getString("county"),
rs.getString("post_code"),rs.getString("country"),rs.getString("fax"),
rs.getString("telephone"),rs.getString("contact_name"),rs.getString("email"));
return cust;
customerForm class
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
public class CustomerForm extends JFrame implements ActionListener {
private Customer currentCustomer;
private CustomerList inCustomerList;
private JPanel panel;
private JTextField textCustomer_id,textCustomer_name,textAddress1,textAddress2,textTown,
textCounty,textPost_code,textCountry,textTelephone,textFax,textContact_name,textEmail,textFind;
private JButton nextCust, prevCust,firstCust,lastCust,newCust,
findCust,add,save,delete,jobs,close,deleteCust;
public CustomerForm(CustomerList inC)throws SQLException{
inCustomerList = inC;
currentCustomer = inCustomerList.getFirstCustomer();
displayForm();
displayFields();
setTextFields();
displayButtons();
getContentPane().add(panel);
setVisible(true);
public void displayForm() throws SQLException{
setTitle("Customer Form");
setSize(700,500);
// Center the frame
Dimension dim = getToolkit().getScreenSize();
setLocation(dim.width/2-getWidth()/2, dim.height/2-getHeight()/2);
getContentPane().setLayout(new BorderLayout());
Border etched = BorderFactory.createEtchedBorder();
panel = new JPanel();
panel.setLayout( null );
Border paneltitled = BorderFactory.createTitledBorder(etched,"");
panel.setBorder(paneltitled);
panel.setBackground(new Color(224,224,255));
public void displayFields() throws SQLException{
int x = 10;
int y = 50;
int textheight = 20;
int textwidth = 150;
int labelwidth = 110;
int ydist = textheight + 10;
int xdist = textwidth*2;
JLabel labelCustomer_id = new JLabel("Customer Number:");
labelCustomer_id.setBounds( x, y, labelwidth, textheight);
panel.add(labelCustomer_id);
JLabel labelCustomer_name = new JLabel("Customer Name:");
labelCustomer_name.setBounds(xdist, y, labelwidth, textheight);
panel.add(labelCustomer_name);
JLabel labelAddress1 = new JLabel("Address 1:");
labelAddress1.setBounds( x, y+ydist, labelwidth, textheight);
panel.add(labelAddress1);
JLabel labelAddress2 = new JLabel("Address 2:");
labelAddress2.setBounds( xdist, y+ydist, labelwidth, textheight);
panel.add(labelAddress2);
JLabel labelTown = new JLabel("Town:");
labelTown.setBounds(x, y+ydist*2, labelwidth, textheight);
panel.add(labelTown);
JLabel labelCounty = new JLabel("County:");
labelCounty.setBounds(xdist, y+ydist*2, labelwidth, textheight);
panel.add(labelCounty);
JLabel labelPost_code = new JLabel("Post Code:");
labelPost_code.setBounds(x, y+ydist*3, labelwidth, textheight);
panel.add(labelPost_code);
JLabel labelCountry = new JLabel("Country:");
labelCountry.setBounds(xdist, y+ydist*3, labelwidth, textheight);
panel.add(labelCountry);
JLabel labelTelephone = new JLabel("Phone:");
labelTelephone.setBounds(x, y+ydist*4, labelwidth, textheight);
panel.add(labelTelephone);
JLabel labelFax = new JLabel("Fax:");
labelFax.setBounds(xdist, y+ydist*4, labelwidth, textheight);
panel.add(labelFax);
JLabel labelContact_name = new JLabel("Contact Name:");
labelContact_name.setBounds(x, y+ydist*5, labelwidth, textheight);
panel.add(labelContact_name);
JLabel labelEmail = new JLabel("E-mail address:");
labelEmail.setBounds(xdist, y+ydist*5, labelwidth, textheight);
panel.add(labelEmail);
JLabel labelFind = new JLabel("Customer Number Search:");
labelFind.setBounds( 40, 360, 200, textheight);
panel.add(labelFind);
textAddress1 = new JTextField();
textAddress1.setBounds(x+labelwidth, y+ydist, textwidth, textheight);
panel.add(textAddress1);
textAddress2 = new JTextField();
textAddress2.setBounds(xdist+labelwidth, y+ydist, textwidth, textheight);
panel.add(textAddress2);
textTown = new JTextField();
textTown.setBounds(x+labelwidth, y+ydist*2, textwidth, textheight);
panel.add(textTown);
textCounty = new JTextField();
textCounty.setBounds(xdist+labelwidth, y+ydist*2, textwidth, textheight);
panel.add(textCounty);
textPost_code = new JTextField();
textPost_code.setBounds(x+labelwidth, y+ydist*3, textwidth, textheight);
panel.add(textPost_code);
textCountry = new JTextField();
textCountry.setBounds(xdist+labelwidth, y+ydist*3, textwidth, textheight);
panel.add(textCountry);
textTelephone = new JTextField();
textTelephone.setBounds(x+labelwidth, y+ydist*4, textwidth, textheight);
panel.add(textTelephone);
textFax = new JTextField();
textFax.setBounds(xdist+labelwidth, y+ydist*4, textwidth, textheight);
panel.add(textFax);
textContact_name = new JTextField();
textContact_name.setBounds(x+labelwidth, y+ydist*5, textwidth, textheight);
panel.add(textContact_name);
textEmail = new JTextField();
textEmail.setBounds(xdist+labelwidth, y+ydist*5, textwidth+50, textheight);
panel.add(textEmail);
textFind = new JTextField();
textFind.setBounds(200, 360, 80, textheight);
panel.add(textFind);
textCustomer_id = new JTextField();
textCustomer_id.setBounds(x+labelwidth, y, textwidth, textheight);
panel.add(textCustomer_id);
textCustomer_name = new JTextField();
textCustomer_name.setBounds(xdist+labelwidth, y, textwidth+50, textheight);
panel.add(textCustomer_name);
public boolean delete() {
textCustomer_id.setText("");
textCustomer_name.setText("");
textAddress1.setText("");
textAddress2.setText("");
textTown.setText("");
textCounty.setText("");
textPost_code.setText("");
textCountry.setText("");
textTelephone.setText("");
textFax.setText("");
textContact_name.setText("");
textEmail.setText("");
textFind.setText("");
return true;
public void displayButtons(){
firstCust= new JButton("FIRST");
firstCust.addActionListener(this);
firstCust.setBounds(50, 430, 100, 20 );
panel.add( firstCust );
nextCust = new JButton("NEXT");
nextCust.addActionListener(this);
nextCust.setBounds(150, 430, 100, 20 );
panel.add( nextCust );
prevCust = new JButton("PREVIOUS");
prevCust.addActionListener(this);
prevCust.setBounds(250, 430, 100, 20 );
panel.add( prevCust );
lastCust= new JButton("LAST");
lastCust.addActionListener(this);
lastCust.setBounds(350, 430, 100, 20 );
panel.add( lastCust );
findCust= new JButton("FIND");
findCust.addActionListener(this);
findCust.setBounds(350, 360, 100, 20 );
panel.add( findCust );
add = new JButton("ADD");
add.addActionListener(this);
add.setBounds(150, 400, 100, 20 );
panel.add( add );
save = new JButton("SAVE");
save.addActionListener(this);
save.setBounds(250, 400, 100, 20 );
panel.add( save );
jobs = new JButton("JOBS");
jobs.addActionListener(this);
jobs.setBounds(550, 360, 100, 20 );
panel.add( jobs );
close = new JButton("CLOSE");
close.addActionListener(this);
close.setBounds(550, 430, 100, 20 );
panel.add( close );
delete = new JButton("DELETE");
delete.addActionListener(this);
delete.setBounds(350, 400, 100, 20 );
panel.add( delete );
deleteCust = new JButton("DELETECUST");
deleteCust.addActionListener(this);
deleteCust.setBounds(450, 400, 100, 20);
panel.add( deleteCust );
public void getTextFields(){
currentCustomer.setCustomer_id(Integer.parseInt(textCustomer_id.getText()));
currentCustomer.setCustomer_name(textCustomer_name.getText());
currentCustomer.setAddress1(textAddress1.getText());
currentCustomer.setAddress2(textAddress2.getText());
currentCustomer.setTown(textTown.getText());
currentCustomer.setCounty(textCounty.getText());
currentCustomer.setPost_code(textPost_code.getText());
currentCustomer.setCountry(textCountry.getText());
currentCustomer.setFax(textFax.getText());
currentCustomer.setTelephone(textTelephone.getText());
currentCustomer.setContact_name(textContact_name.getText());
currentCustomer.setEmail(textEmail.getText());
public void setTextFields() throws SQLException{
textCustomer_id.setText(String.valueOf(currentCustomer.getCustomer_id()));
textCustomer_id.setEditable(false);
textCustomer_name.setText(currentCustomer.getCustomer_name());
textAddress1.setText(currentCustomer.getAddress1());
textAddress2.setText(currentCustomer.getAddress2());
textTown.setText(currentCustomer.getTown());
textCounty.setText(currentCustomer.getCounty());
textPost_code.setText(currentCustomer.getPost_code());
textCountry.setText(currentCustomer.getCountry());
textFax.setText(currentCustomer.getFax());
textTelephone.setText(currentCustomer.getTelephone());
textContact_name.setText(currentCustomer.getContact_name());
textEmail.setText(currentCustomer.getEmail());
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
try {
if (source == nextCust)
currentCustomer = inCustomerList.getNextCustomer();
else if (source == prevCust)
currentCustomer = inCustomerList.getPreviousCustomer();
else if (source == findCust) {
try {
currentCustomer =
inCustomerList.findCustomer(Integer.parseInt(textFind.getText()));
catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(
null, "Invalid Customer number", "ERROR",
JOptionPane.ERROR_MESSAGE);
if (currentCustomer == null) {
JOptionPane.showMessageDialog(null, "Customer not found");
currentCustomer = inCustomerList.getFirstCustomer();
textFind.setText(null);
else if (source == firstCust)
currentCustomer = inCustomerList.getFirstCustomer();
else if (source == lastCust)
currentCustomer = inCustomerList.getLastCustomer();
else if (source == add) {
currentCustomer = inCustomerList.addCust();
add.setEnabled(false);
else if (source == delete) {
delete();
else if (source == save) {
add.setEnabled(true);
getTextFields();
currentCustomer = inCustomerList.saveCustomer(currentCustomer);
//else if (source == jobs) {
// JFrame newJobForm = new JobForm(currentCustomer.getJobList());
//else if (source == deleteCust) {
//........... //currentCustomer = inCustomerList.deleteCustomer(currentCustomer);
else if (source == close) {
dispose();
setTextFields();
nextCust.setEnabled(!inCustomerList.isLast());
prevCust.setEnabled(!inCustomerList.isFirst());
firstCust.setEnabled(!inCustomerList.isFirst());
lastCust.setEnabled(!inCustomerList.isLast());
catch (SQLException ex) {
System.out.println("Failed");
System.out.println(ex.getMessage());
ex.printStackTrace();
System.exit(-1);
PLEASE HELP ME!!!

http://www.ss64.demon.co.uk/orasyntax/

Similar Messages

  • TS1424 My Apple ID has been disabled. I have tried everything and cant get any help correcting it. Any suggestions?? Please help!! I have 25 updates and can't update anything

    My Apple ID has been disabled. I have tried everything and cant get any help correcting it. Any suggestions?? Please help!! I have 25 updates and can't update anything

    http://www.apple.com/support/contact/

  • I recently tried to download two movies.  Would not complete download. Movies were removed from que, however, the Ipade now shows 10MB of "Other" content that I cannot delete. Any suggestions?

    Tried to download two movies. Neither was successful. Apple removed them from download que and reimbursed cost. Now I have 10MB of "Other" content that I cannot delete.  There are NO movies listed on the Ipad or Itunes to delete.  Any suggestions?

    To Scxy1234: I also don't know why my paste special options only had 3 choices excluding "device independent bitmap'
    To Steve Fan: I created the new second user account in my window 8. It was set as a standard account, not as administrator account as my first original user account. Specifically, i used the same email address with this forum account's to
    create this second user account. It means that the second user account in my laptop also was a Microsoft account.
    Can you guess what happened after i had logged in to the second user account? I opened some random websites by firefox, copied and pasted all text and pictures on these websites into a word document and onenote successfully without any problems!!!!
    I saved this word document and exported this onenote section to a Usb. After that, i switched from second standard user account to my window administrator account and opened the two files which were saved to Usb previously. They were opened and displayed
    normally as the same as what i previously had seen in the second user account, i.e. pasted text and pictures were displayed normally. However, when i opened the same web address again to copy the same text and pictures to word and onenote, there were only
    text lines pasted successfully, excluding pictures! This old strange problem happened again when using original administrator account for logging in window. In contrast, when using the second standard user account to log in window, copying and pasting text
    and online pictures of Microsoft office worked normally.
    I truly don't figure out the reason(s) caused this strange problem. I think my case is a special case because i tried all solutions other people had tried but nothing worked.
    Please help me!
    p/s: when i logged in the second standard user account, i opened the paste special options in word and there were only 3 choices under paste special options, excluding "device independent bitmap"

  • In my contacts, I want to edit information. Some of this information is 'grayed out' and I am not able to delete it - any suggestions are greatly appreciated. Thanks

    In my contacts, I want to edit information. Some of this information is 'grayed out' and I am not able to delete it - any suggestions are greatly appreciated. Thanks

    For example:  SusanX has quit her job and I still have her employment email address and phone number.  All her other information is the same but I want to delete the information no long viable. When I go into edit mode the information is grayed out and is not deletable. I went to my iCloud and tried to delete it there, no luck.
    I am thinking I might just have to delete the entire contact card and just start from scratch with only her current information.  Seems like there should be a way to delete only parts of the information rather that resort to start a new contact card.
    Thanks for your help. I appreciate you taking the time to advise me on this.
    Mona

  • When I try to delete page(s) from a PDF document I created, I geth the following message: "One or more pages are in use and could not be deleted." Any suggestions?

    When I try to delete page(s) from a PDF document I created, I geth the following message: "One or more pages are in use and could not be deleted." Any suggestions?

    I sent an email to TerraGo Support and they sent the following response: "This has bug has been discovered and our development team is quickly creating a patch to resolve the problem. The patch should be available within a week or two. For your reference, the bug number assigned to this case is: 3620. Check back in about two weeks and hopefully the patch will be available. Again, I apologize for the inconvenience."

  • HT3702 How can I stop and remove my credit card from my iPad ,my children keep buying games and I want to stop it......please help me to remove any payment from now on.

    How can I stop and remove my credit card from my iPad ,my children keep buying games and I want to stop it......please help me to remove any payment from now on.

    iOS: Understanding Restrictions
              http://support.apple.com/kb/HT4213

  • Please Help with Deleting and Putting in Music

    Hi. I have a Nokia5300 Express Music. I want to add music on it but i don't know how. I have windows media player the PC suite thing and everything. But I don't know how to delete music or import music please help. This is very different from the ways i do it from the Ipod ...
    HELP HELP HELP

    wait wait guys please help me delete my music i really want to delete ALL my music and put in NEW music i hate the windows media player iuno how to unsync it and delete it T_T

  • Please help with this method, cant get it to work correctly.

    any suggestions AT ALL please, im really stuck with this.
    im creating a little animation of pacman, just an animation of it moving buy its self. im using the java elements package so this is all being shown in a drawing window.
    ive made it move fine and go round the window abit eating dots but the code is a mess, and i know i could change some of the main part into a few simple methods and have tried but it seems to stop moving when i try
    import element.*;
    import java.awt.Color;
    static DrawingWindow d = new DrawingWindow(500,500);  
       public static void wait1second()
        //  pause for one tenth of a second second
            long now = System.currentTimeMillis();
            long then = now + 100; // 100 milliseconds
            while (System.currentTimeMillis() < then)
        public static void waitNSeconds(int number)
            int i;
            for (i = 0; i < number; i++) //allows you to determine how long to pause for
                wait1second();
    public static void main(String[] args) {
        //  declaring the variables
        int pacsize1 = 50, pacsize2 = 50;
        int pac1x = 20, pac1y = 20;
        int pacmouth1 = 45, pacangle1 = 270;
        int pacmouth2 = 25, pacangle2 = 320;
        int pacmouth3 = 6, pacangle3 = 348;
        int startmv = 0, stopmv = 33;
        d.setForeground(Color.black);
        Rect bkrnd = new Rect(0,0,500,500);     
        d.fill(bkrnd);
       // while loop used to make the pacman shape move right across the screen with its mouth in three different states
    Arc pacarc = new Arc();
         while (startmv++<stopmv)
            pac1x += 4;
            d.setForeground(Color.yellow);
            pacarc = new Arc(pac1x,pac1y,pacsize1,pacsize2,pacmouth1,pacangle1);
            d.fill(pacarc);
            d.setForeground(Color.black);
            waitNSeconds(1);
            d.fill(pacarc);
            pac1x += 4;
            d.setForeground(Color.yellow);
            pacarc = new Arc(pac1x,pac1y,pacsize1,pacsize2,pacmouth2,pacangle2);
            d.fill(pacarc);
            d.setForeground(Color.black);
            waitNSeconds(1);
            d.fill(pacarc);
            pac1x += 4;
            d.setForeground(Color.yellow);
            pacarc = new Arc(pac1x,pac1y,pacsize1,pacsize2,pacmouth3,pacangle3);
            d.fill(pacarc);
            d.setForeground(Color.black);
            waitNSeconds(1);
            d.fill(pacarc);
    }so i tried making a method to make all the stuf in the while loop alot simpler but it just keeps making the pacman not move at all and im not sure why. heres the code i tried for the method:
    public static void pacmve(int pactestx, int pactesty, int pacsizetest1, int pacsizetest2, int pacmouthtest, int pacangletest)
            pactestx += 4;
            Arc pacarc = new Arc();
            d.setForeground(Color.yellow);
            pacarc = new Arc(pactestx,pactesty,pacsizetest1,pacsizetest2,pacmouthtest,pacangletest);
            d.fill(pacarc);
            d.setForeground(Color.black);
            waitNSeconds(1);
            d.fill(pacarc);
            }it had no problems with the code, but it just doesnt seem to do anything when i call it in the while loop. heres how i used it to try and just make it move across with the mouth in one state:
    while (startmv++<stopmv)
    pacmve(20,20,50,50,45,270);
    }any ideas?
    Edited by: jeffsimmo85 on Nov 22, 2007 2:36 AM

    the clock is still ticking while you do this:
    while (System.currentTimeMillis() < then)
    is that method your design? why not just call Thread.sleep()?
    %

  • PLEASE HELP - Stupidly deleted "Apple Application Support" Unable to Access Itunes Library (5,000+ songs at stake) = :(

    PLEASE HELP - I have stupidly deleted the apple application support off my computer, and I am unable to launch my Itunes..It advises me to download itunes again, however i am TERRIFIED to do so because I have over 5,000 songs in my Library and no doubt my entire collection will inevitably be wiped.PLEASE HELP..I am almost in tears. I have attempted searching google for "Apple Application" Support downloads however it directs me to the apple website, and to no avail I cannot find anything to aid me...any responses would be greatly appreciated..!!!!!!!!!!

    Reinstall iTunes from Apple's website. Reinstalling iTunes does not wipe your library, but you should have a backup regardless.
    tt2

  • PLEASE HELP!!! ANY REPLIES??? IMOVIE/QUICKTIME UNEXPECTEDLY QUIT

    I have a macbook, it is operating at 10.4.8 I have done everything I can think of. I have upgraded in imovie, i have updated all system updates, as well as the new firmware. However, once i did all of this i noticed that i could not get video through safari. I thought I was having problem with flip 4 mac, now i cant get any video on anything. I cannot open imovie, i cannot open quicktime, at all. If anyone has an idea, please help me!!

    iMovie: Unexpectedly Quits When You Add Audio to a Project
    http://docs.info.apple.com/article.html?artnum=93368
    iMovie: iMovie Unexpectedly Quits When Accessing iMovie Help
    http://docs.info.apple.com/article.html?artnum=75323
    iMovie: How to Troubleshoot "Application Unexpectedly Quit"
    http://docs.info.apple.com/article.html?artnum=93203
    iMovie: Some Third-Party Codecs May Cause iMovie to Unexpectedly Quit
    http://docs.info.apple.com/article.html?artnum=93267
    :)Sue

  • Please, I don't want any suggestions from the awesome bar! Using the tools menu does not stop it...

    I don't want any suggestions! I have set the control through the Options many time to nothing but it always comes back with a new session. Please can I stop it completely!

    If you do not keep changes after a restart or otherwise have problems with preferences, see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Please help invalid payment method

    I am trying to purchase a game that costs 0.79 and i put my credit card that i use to buy everything from apple and it says to me that my payment method is declined. Why is this happened please help...

    try to add the payment  information through itunes store on your computer
    Go to Itunes store, choose account from the menu on the right.
    Peace
    Really is nothing anyone can do here, maybe purchase a itunes gift card, makes things more streamline and keeps you on a budget. Plus no one can steal your credit info.
    Just my two cents "unsubscribing"

  • Please help me (JNI method)

    Hi here's Getch.java
           public class Getch {
       // private Getch(){}
        public static native int getch();
        public static void main(String[] args){
        char k  =  (char)  new Getch().getch();
        System.out.prinln( +key ) ;
        static {System.loadLibrary("Getch");}
          Getch.c file
      #include<stdio.h>
    #include<jni.h>
    #include "Getch.h"
    JNIEXPORT jint JNICALL Java_Getch_getch(JNIEnv *env, jclass lass )
        return getch();
    }compilation command
    javac Getch.java
    javah -jni Getch
    gcc -o libGetch.so -shared -Wl,-soname,libGetch.so -I /opt/jdk1.5.0_11/include/ -I /opt/jdk1.5.0_11/include/linux/ Getch.c -static -lc
    all thing going the way I expect.. but when i try to run
    java Getch
    it gives error as Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/raj/tmp/dump/jni/libGetch.so: Can't load IA 32-bit .so on a IA 32-bit platform
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:993)
    at Getch.<clinit>(Getch.java:9)
    i am not sure where i am wrong.. please help me its urgent for me..
    Thanks in advance.

    <snip>
    l thing going the way I expect.. but when i try to
    run
    java Getch
    it gives error as Exception in thread "main"
    java.lang.UnsatisfiedLinkError:
    /home/raj/tmp/dump/jni/libGetch.so: Can't load IA
    32-bit .so on a IA 32-bit platformSee bug report:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6515362

  • My inbox has many (NoSender) (No Subject) entries that I cannot delete.  Any suggestions?

    My iPhone inbox gets these (No Sender) (No Subject) messages with wierd dates.  I try to delete them, but they show no circle to check under the edit command.  Any suggestions?

    Delete the email at the source - at the incoming mail server level via webmail access for the account using a browser on your computer or with Safari on your iPhone.

  • Please Help! Deleting multiple record by using checkbox selected

    Hello everybody,
    I am a new to JSP. I really don't know how to delete multiple record by using checkbox selected and pressing submit button.
    For example, deleting webmailbox letters using checkbox selected and delete button. The mail we checked will delete from the inbox.
    I like to use my user account deleting system of my project like above example.
    How can I do in JSP? I will very please you if you share you knowledge and code for me.
    If you have URL address, could you share me for reference?
    Please help me...
    With Thanks and Regards,
    wtdahl

    Take a look at this thread, I thing it answers your question quite good:
    http://forum.java.sun.com/thread.jsp?thread=516658&forum=45&message=2463505

Maybe you are looking for

  • Horizontal Photo Scroll/Swipe Gallery

    Hi All, I am making a horizontal Photo Gallery larger than 10,000 px in width. Users should be able to Swipe  (on touch devices) and Scroll on Pc. I came across some previous posts like this, but i dont know where to begin. https://forums.adobe.com/m

  • I want to download specific music to my IPad so i can access it offline.  Sync with iOS 8is not putting the music or playlists I have chosen on my computer onto my iPad.

    I want to download specific music to my IPad so I can access it off line.  I have iOS 8 on my Mac mini and my pad.  The artists, albums and playlists I have selected to sync on my Mac mini do not show up on my iPad.  I am involved in international vo

  • Clean Up my MacBook Pro

    My beloved old MacBookPro has been slowing down day by day and the latest version of the OS hasn't helped. (Maverick) I use this machine when I go on photo shoots and for simple web browsing and mail. I am thinking of taking drastic action to reclaim

  • Breaking text threads in CS5

    I am trying to break a text thread and have followed the Adobe Support directions (below). None of them work, at least they don't for me. If I double-click a port, it just creates a new text box threaded to the previous one. Under Type I don't even s

  • ITunes is very buggy.

    Hangs on start-up; have to use task manager to force-close it When it does run, it does not detect my iPhone/iTouch; my PC detects it, iTunes doesn't Already reinstalled for the 2nd time