Need more help with a GUI

It's the ever popular Inventory program again! I'm creating a GUI to display the information contained within an array of objects which, in this case, represent compact discs. I've received some good help from other's posts on this project since it seems there's a few of us working on the same one but now, since each person working on this project has programmed theirs differently, I'm stuck. I'm not sure how to proceed with my ActionListeners for the buttons I've created.
Here's my code:
// GUICDInventory.java
// uses CD class
import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class GUICDInventory extends JFrame
     protected JPanel panel; //panel to hold buttons
     protected JPanel cdImage; // panel to hold image
     int displayElement = 0;
     public String display(int element)
               return CD2[element].toString();
          }//end method
     public static void main( String args[] )
          new GUICDInventory();
     }// end main
     public GUICDInventory()
          CD completeCDInventory[] = new CD2[ 5 ]; // creates a new 5 element array
         // populates array with objects that implement CD
         completeCDInventory[ 0 ] = new CD2( "Sixpence None the Richer" , "D121401" , 12 , 11.99, 1990 );
         completeCDInventory[ 1 ] = new CD2( "Clear" , "D126413" , 10 , 10.99, 1998 );
         completeCDInventory[ 2 ] = new CD2( "NewsBoys: Love Liberty Disco" , "2438-51720-2" , 10 , 12.99, 1999 );
         completeCDInventory[ 3 ] = new CD2( "Skillet: Hey You, I Love Your Soul" , "D122966" , 9 , 9.99, 1998 );
         completeCDInventory[ 4 ] = new CD2( "Michael Sweet: Real" , "020831-1376-204" , 15 , 12.99, 1995 );
         //declares totalInventoryValue variable
             double totalInventoryValue = CD.calculateTotalInventory( completeCDInventory );
          final JTextArea textArea = new JTextArea(display(displayElement));
          final JButton prevBtn = new JButton("Previous");
          final JButton nextBtn = new JButton("Next");
          final JButton lastBtn = new JButton("Last");
          final JButton firstBtn = new JButton("First");
          prevBtn.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent ae)
                    displayElement = (//what goe here? ) % //what goes here?
                    textArea.setText(display(displayElement));// <--is this right?
          nextBtn.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent ae)
                      displayElement = (//what goes here? ) % //what goes here?
                    textArea.setText(display(displayElement));// <--is this right?
          firstBtn.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent ae)
                    displayElement = 0;
                    textArea.setText(display(displayElement));// <--is this right?
          lastBtn.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent ae)
                    displayElement = //what goes here?;
                    textArea.setText(display(displayElement));// <--is this right?
          JPanel panel = new JPanel(new GridLayout(1,2));
          panel.add(firstBtn); panel.add(nextBtn); panel.add(prevBtn); panel.add(lastBtn);
          JPanel cdImage = new JPanel(new BorderLayout());
          cdImage.setPreferredSize(new Dimension(600,400));
          JFrame      cdFrame = new JFrame();
          cdFrame.getContentPane().add(new JScrollPane(textArea),BorderLayout.CENTER);
          cdFrame.getContentPane().add(panel,BorderLayout.SOUTH);
          cdFrame.getContentPane().add(new JLabel("",new ImageIcon("cd.gif"),JLabel.CENTER),BorderLayout.NORTH);
          cdFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          cdFrame.pack();
          cdFrame.setSize(500,200);
          cdFrame.setTitle("Compact Disc Inventory");
          cdFrame.setLocationRelativeTo(null);
          cdFrame.setVisible(true);
     }//end GUICDInventory constructor
} // end class GUICDInventory
// CD2.java
// subclass of CD
public class CD2 extends CD
     protected int copyrightDate; // CDs copyright date variable declaration
     private double price2;
     // constructor
     public CD2( String title, String prodNumber, double numStock, double price, int copyrightDate )
          // explicit call to superclass CD constructor
          super( title, prodNumber, numStock, price );
          this.copyrightDate = copyrightDate;
     }// end constructor
     public double getInventoryValue() // modified subclass method to add restocking fee
        price2 = price + price * 0.05;
        return numStock * price2;
    } //end getInventoryValue
    // Returns a formated String contains the information about any particular item of inventory
    public String displayInventory() // modified subclass display method
          return String.format("\n%-22s%s\n%-22s%d\n%-22s%s\n%-22s%.2f\n%-22s%s%.2f\n%-22s%s%.2f\n%-22s%s%.2f\n  \n" ,
                                   "CD Title:", title, "Copyright Date:", copyrightDate, "Product Number:", prodNumber , "Number in Stock:",
                                   numStock , "CD Price:" , "$" , price , "Restocking fee (5%):", "$", price*0.05, "Inventory Value:" , "$" ,
                                   getInventoryValue() );
     } // end method
}//end class CD2
// CD.java
// Represents a compact disc object
import java.util.Arrays;
class CD implements Comparable
    protected String title; // CD title (name of product)
    protected String prodNumber; // CD product number
    protected double numStock; // CD stock number
    protected double price; // price of CD
    protected double inventoryValue; //number of units in stock times price of each unit
    // constructor initializes CD information
    public CD( String title, String prodNumber, double numStock, double price )
        this.title = title; // Artist: album name
        this.prodNumber = prodNumber; //product number
        this.numStock = numStock; // number of CDs in stock
        this.price = price; //price per CD
    } // end constructor
    public double getInventoryValue()
        return numStock * price;
    } //end getInventoryValue
    //Returns a formated String contains the information about any particular item of inventory
    public String displayInventory()
          //return the formated String containing the complete information about CD
        return String.format("\n%-22s%s\n%-22s%s\n%-22s%.2f\n%-22s%s%.2f\n%-22s%s%.2f\n%-22s%s%.2f\n  \n" ,
                                   "CD Title:", title, "Product Number:", prodNumber , "Number in Stock:",
                                   numStock , "CD Price:" , "$" , price , "Restocking fee (5%):", "$", price*0.05, "Inventory Value:" , "$" ,
                                   getInventoryValue() );
    } // end method
    //method to calculate the total inventory of the array of objects
    public static double calculateTotalInventory( CD completeCDInventory[] )
        double totalInventoryValue = 0;
        for ( int count = 0; count < completeCDInventory.length; count++ )
             totalInventoryValue += completeCDInventory[count].getInventoryValue();
        } // end for
        return totalInventoryValue;
    } // end calculateTotalInventory
     // Method to return the String containing the Information about Inventory's Item
     //as appear in array (non-sorted)
    public static String displayTotalInventory( CD completeCDInventory[] )
          //string which is to be returned from the method containing the complete inventory's information
          String retInfo = "\nInventory of CDs (unsorted):\n";
          //loop to go through complete array
          for ( int count = 0; count < completeCDInventory.length; count++ )
               retInfo = retInfo + "Item# " + (count + 1);          //add the item number in String
               retInfo = retInfo + completeCDInventory[count].displayInventory();     //add the inventory detail in String
          }// end for
          return retInfo;          //return the String containing complete detail of Inventory
    }// end displayTotalInventory
     public int compareTo( Object obj ) //overlaod compareTo method
          CD tmp = ( CD )obj;
          if( this.title.compareTo( tmp.title ) < 0 )
               return -1; //instance lt received
          else if( this.title.compareTo( tmp.title ) > 0 )
               return 1; //instance gt received
          return 0; //instance == received
          }// end compareTo method
     //Method to return the String containing the Information about Inventory's Item
     // in sorted order (sorted by title)
     public static String sortedCDInventory( CD completeCDInventory[] )
          //string which is to be returned from the method containing the complete inventory's information
          String retInfo = "\nInventory of CDs (sorted by title):\n";
          Arrays.sort( completeCDInventory ); // sort array
          //loop to go through complete array
          for( int count = 0; count < completeCDInventory.length; count++ )
               retInfo = retInfo + "Item# " + (count + 1);     //add the item number in String
               retInfo = retInfo + completeCDInventory[count].displayInventory(); //add the inventory detail in String
          return retInfo;     //return the String containing complete detail of Inventory
     } // end method sortedCDInventory
} // end class CD

nextBtn.addActionListener(new ActionListener()
     public void actionPerformed(ActionEvent ae)
               displayElement = (//what goes here? ) % //what goes here?
               textArea.setText(display(displayElement));// <--is this right?
});Above is your code for the "Next" button.
You ask the question "What goes here"? Well what do you think goes there?
If you are looking at item 1 and you press the "Next" button do you not want to look at item 2?
So the obvious solution would be to add 1 to the previous item value. Does that not make sense? What problem do you have when you try that code?????
Next you say "Is this right"? Well how are we supposed to know? You wrote the code. We don't know what the code is supposed to do. Again you try it. If it doesn't work then describe the problem you are having. I for one can't execute your code because I don't use JDK5. So looking at the code it looks reasonable, but I can't tell by looking at it what is wrong. Only you can add debug statements in the code to see whats happening.
If you want help learn to as a proper question and doen't expect us to spoon feed the code to you. This is your assignment, not ours. We are under no obligation to debug and write the code for you. The sooner you learn that, the more help you will receive.

Similar Messages

  • Hi, can anyone help me out with this, I need some help on designing GUI for e-learning coursewares. Some tutorials or some helpful sites will do.

    I need some help with the GUI design.

    Have you tried the line inputs on the back of your FirePod? If you update its firmware (not sure if you will need to or not), I seem to remember hearing that the FirePod can run without FW connection, i.e. stand alone. In this mode with the outs from your mixer into line ins 1-2 (2nd from left on the back) it should work fine. I say should because I have never tried. However, these are used for returns from an external effects unit. I assume here, and the important word is assume, that there are two so that they can be used as a stereo send or as a mono send. Worth a try! Let us know how it goes.
    Best, Fred

  • I need your help with a decision to use iPhoto.  I have been a PC user since the mid 1980's and more recently have used ACDSee to manage my photo images and Photoshop to edit them.  I have used ProShow Gold to create slideshows.  I am comfortable with my

    I need your help with a decision to use iPhoto.  I have been a PC user since the mid 1980’s and more recently have used ACDSee to manage my photo images and Photoshop to edit them.  I have used ProShow Gold to create slideshows.  I am comfortable with my own folder and file naming conventions. I currently have over 23,000 images of which around 60% are scans going back 75 years.  Since I keep a copy of the originals, the storage requirements for over 46,000 images is huge.  180GB plus.
    I now have a Macbook Pro and will add an iMac when the new models arrive.  For my photos, I want to stay with Photoshop which also gives me the Bridge.  The only obvious reason to use iPhoto is to take advantage of Faces and the link to iMovie to make slideshows.  What am I missing and is using iPhoto worth the effort?
    If I choose to use iPhoto, I am not certain whether I need to load the originals and the edited versions. I suspect that just the latter is sufficient.  If I set PhotoShop as my external editor, I presume that iPhoto will keep track of all changes moving forward.  However, over 23,000 images in iPhoto makes me twitchy and they are appear hidden within iPhoto.  In the past, I have experienced syncing problems with, and database errors in, large databases.  If I break up the images into a number of projects, I loose the value of Faces reaching back over time.
    Some guidance and insight would be appreciated.  I have a number of Faces questions which I will save for later. 

    Bridge and Photoshop is a common file-based management system. (Not sure why you'd have used ACDSEE as well as Bridge.) In any event, it's on the way out. You won't be using it in 5 years time.
    Up to this the lack of processing power on your computer left no choice but to organise this way. But file based organisation is as sensible as organising a Shoe Warehouse based on the colour of the boxes. It's also ultimately data-destructive.
    Modern systems are Database driven. Files are managed, Images imported, virtual versions, lossless processing and unlimited editing are the way forward.
    For a Photographer Photoshop is overkill. It's an enormously powerful app, a staple of the Graphic Designers' trade. A Photographer uses maybe 15% to 20% of its capability.
    Apps like iPhoto, Lightroom, Aperture are the way forward - for photographers. There's the 20% of Photoshop that shooters actually use, coupled with management and lossless processing. Pop over to the Aperture or Lightroom forums (on the Adobe site) and one comment shows up over and over again... "Since I started using Aperture/ Lightroom I hardly ever use Photoshop any more..." and if there is a job that these apps can do, then the (much) cheaper Elements will do it.
    The change is not easy though, especially if you have a long-standing and well thought out filing system of your own. The first thing I would strongly advise is that you experiment before making any decisions. So I would create a Library, import 300 or 400 shots and play. You might as well do this in iPhoto to begin with - though if you’re a serious hobbyist or a Pro then you'll find yourself looking further afield pretty soon. iPhoto is good for the family snapper, taking shots at birthdays and sharing them with friends and family.
    Next: If you're going to successfully use these apps you need to make a leap: Your files are not your Photos.
    The illustration I use is as follows: In my iTunes Library I have a file called 'Let_it_Be_The_Beatles.mp3'. So what is that, exactly? It's not the song. The Beatles never wrote an mp3. They wrote a tune and lyrics. They recorded it and a copy of that recording is stored in the mp3 file. So the file is just a container for the recording. That container is designed in a specific way attuned to the characteristics and requirements of the data. Hence, mp3.
    Similarly, that Jpeg is not your photo, it's a container designed to hold that kind of data. iPhoto is all about the data and not about the container. So, regardless of where you choose to store the file, iPhoto will manage the photo, edit the photo, add metadata to the Photo but never touch the file. If you choose to export - unless you specifically choose to export the original - iPhoto will export the Photo into a new container - a new file containing the photo.
    When you process an image in iPhoto the file is never touched, instead your decisions are recorded in the database. When you view the image then the Master is presented with these decisions applied to it. That's why it's lossless. You can also have multiple versions and waste no disk space because they are all just listings in the database.
    These apps replace the Finder (File Browser) for managing your Photos. They become the Go-To app for anything to do with your photos. They replace Bridge too as they become a front-end for Photoshop.
    So, want to use a photo for something - Export it. Choose the format, size and quality you want and there it is. If you're emailing, uploading to websites then these apps have a "good enough for most things" version called the Preview - this will be missing some metadata.
    So it's a big change from a file-based to Photo-based management, from editing files to processing Photos and it's worth thinking it through before you decide.

  • Hi guys, need your help with iCloud notes on Mac 10.7.5; I've found this feature's more useful comparing with stickers, however can't pin notes to desktop or dock, "double click"on the note doesn't work with this version of software.

    Hi guys! Need you help with iCloud Notes on Mac Pro 10.7.5. I've found this apllication more useful comparing with "stickers", however can't pin it to desktop or dock. Thanks a lot in advance!

    Hi guys! Need you help with iCloud Notes on Mac Pro 10.7.5. I've found this apllication more useful comparing with "stickers", however can't pin it to desktop or dock. Thanks a lot in advance!

  • I've just came on board from Andriod and need massive help with the Contacts application any one out there willing to help the 'noob'?

    I had the folks at the store port over all of my contacts from my old
    ratty Andriod phone to my new shiny iPhone.
    however all 200+ of my contacts sort of "shook" out,
    meaning say John Smith, on my old phone,
    had in my contacts the following:
    John Smith
    123 Main St. Anytown, Anystate USA
    555-826-4879 home
    555-799-4247 cell
    [email protected]
    johnsmith@facebook
    all nice and neat on my andriod but when it ported over
    all that information was just scattered all over my contacts sort of like:
    john smith, smith john
    john smith 123 main st. etc.
    johhn smith home 555 etc.
    john smith cell 555 etc.
    john smith johnsmith@ etc.
    etc.
    so for all those 200+ contacts in my phone, I've got a zillion of them now...
    so I'd like to get this all back in order before I and Siri explode.
    I know nothing, and I know even less about outlook and the sort.
    But I do know I am in Dire need of help with this... I figured that eveything else
    involving iphones and apple in general was supposed to be cake but it seems
    like this is the only thing that isn't cake at all... unless, I'm just a right idiot. (which is possible, hence spelling and grammatical issues).

    I believe I've tried to sync it with google, but it didn't seem to take
    muchless take my calender. it seems to favor my facebook calender
    more over my google calender, but Siri seems to be helping me re-write
    it...but that's not the game here, it's the contacts. I've tried to export
    the cvp (??) list and import it into my iTunes account. However, It only
    doubled my issue because it didn't over write my existing contacts.

  • Need some help with threads...

    Hello all,
    I am working on a project at work, and I am not the best programmer in the world. I have been trying to get my head around this for a couple of days and just cannot get it to work.
    I am writing an instrumentation control program that will have three threads. One is the GUI, one will receive control information and set up the hardware, and one will check the hardware status and report it to the GUI periodically. I plan on using the invokeLater() method to communicate the status to the GUI and change the status display in the GUI. Communication from the GUI to the controller thread and from the status thread to the controller thread I had planned on being piped input/output stream as appropriate. I have a control class and a status class that need to be communicated over these piped streams. In some trial code I have been unable to wrap the piped input/output streams with object input/output streams. I really need some help with this. Here is the main thread code:
    package playingwiththreads1;
    import java.io.*;*
    *public class PlayingWithThreads1 {*
    public static void main(String[] args) {*
    * PipedOutputStream outputPipe = new PipedOutputStream();*
    * ObjectOutputStream oos = null;*
    * ReceiverThread rt = new ReceiverThread(outputPipe);*
    // Start the thread -- First try*
    * Thread t = new Thread(rt);*
    t.start();*
    // Wrap the output pipe with an ObjectOutputStream*
    try*
    oos = new ObjectOutputStream(outputPipe);*
    catch (IOException e)*
    System.out.println(e);*
    // Start the thread -- Second try*
    //Thread t = new Thread(rt);*
    //t.start();*
    /** Send an object over the pipe. In reality this object will be a
    class that contains control or status information */
    try
    if (!oos.equals(null))
    oos.writeObject(new String ("Test"));
    catch (IOException e)
    try
    Thread.sleep(5000);
    catch (InterruptedException e)
    I read somewhere that it matters where you start the thread relative to where you wrap piped streams with the object streams. So, I tried the two places I felt were obvious to start the thread. These are noted in the comments. Here is the code for the thread.
    package playingwiththreads1;
    import java.io.*;
    public class ReceiverThread implements Runnable {
    private PipedInputStream inputPipe = new PipedInputStream();
    private ObjectInputStream inputObject;
    ReceiverThread (PipedOutputStream outputPipe)
    System.out.println("Thread initialization - start");
    try
    inputPipe.connect(outputPipe);
    inputObject = new ObjectInputStream(inputPipe);
    catch (IOException e)
    System.out.println(e);
    System.out.println("Thread initialization - complete");
    public void run()
    System.out.println("Thread started");
    try
    if (inputObject.available() > 0)
    System.out.println(inputObject.read());
    catch (IOException e)
    System.out.println(e);
    Through testing I have determined that no matter where I start the thread, the thread never gets past the "inputObject = new ObjectInputStream(inputPipe);" assignment.
    Could someone please help me with this? There are other ways for me to write this program, but this is the one that I would like to make work.
    Many thanks in advance,
    Rob Hix
    Edited by: RobertHix on Oct 6, 2009 3:54 AM

    Thanks for the help, but that did not work. I tried flushing the ObjectOutputStream and it is still hanging when initializing the thread.
    Here is a better look at the code since I was helped to figure out how to insert it:
    The main method:
    package playingwiththreads1;
    import java.io.*;
    public class PlayingWithThreads1 {
        public static void main(String[] args) {
            PipedOutputStream outputPipe = new PipedOutputStream();
            ObjectOutputStream oos = null;
            ReceiverThread rt = new ReceiverThread(outputPipe);
            // Start the thread -- First try
            //Thread t = new Thread(rt);
            //t.start();
            // Wrap the output pipe with an ObjectOutputStream
            try
                oos = new ObjectOutputStream(outputPipe);
                oos.flush();
            catch (IOException e)
                System.out.println(e);
            // Start the thread -- Second try
            Thread t = new Thread(rt);
            t.start();
            /* Send an object over the pipe.  In reality this object will be a
             * class that contains control or status information */
            try
                if (!oos.equals(null))
                    oos.writeObject(new String ("Test"));
                    oos.flush();
            catch (IOException e)
                System.out.pringln(e);
            try
                Thread.sleep(5000);
            catch (InterruptedException e)
    }The thread code:
    package playingwiththreads1;
    import java.io.*;
    public class ReceiverThread implements Runnable {
        private PipedInputStream inputPipe = new PipedInputStream();
        private ObjectInputStream inputObject;
        ReceiverThread (PipedOutputStream outputPipe)
            System.out.println("Thread initialization - start");
            try
                inputPipe.connect(outputPipe);
                inputObject = new ObjectInputStream(inputPipe);
            catch (IOException e)
                System.out.println(e);
            System.out.println("Thread initialization - complete");
        public void run()
            System.out.println("Thread started");
            try
                if (inputObject.available() > 0)
                    System.out.println(inputObject.read());
            catch (IOException e)
                System.out.println(e);
    }Does anyone else have and ideas?

  • Need some help with guitar setup...

    jeez, never thought i'd be asking a question like this after playing for like 20 years, but i need some help with a guitar setup for mac. i'm gonna list out a lot of crap here that prolly doesn't affect anything at all, but here goes.
    Imac 17inch G4 - latest updated OS X... 10.4, or 5, or whatever. garageband 3.0
    digitech gnx-3
    alesis sr-16
    sure mic's
    yamaha e203 keyboard
    here's the setup:
    yamaha is on its own on a usb uno midi interface, sure's connected to gnx's xlr port, alesis connected to gnx's jam-a-long input, '87 kramer vanguard connected to gnx's guitar input. currently running headphones out on gnx to line in on mac.
    here's the problem:
    everything works beautifully, but my guitar sounds like crap. if i plug headphones into the gnx, it sounds beautiful. that makes me think its some kind of level issue between the gnx's output, and the mac's input, but nothing seems to fix it.
    by sounding like crap, i mean way too much bass. sound is muddy, blurry, not crisp... aka crap. i've tried altering both output and input on mac and gnx, and i cant get a combination that works. the gnx has a s/pdif out, can the mac accept that as input? might that help? short of running the gnx to my marshal half stack and mic'ing that, anyone have any suggestions, or use a similar setup?
    any help would be greatly appreciated!

    anyone? ... any suggestions? I think it might be an issue with the gnx pre-amping the signal as it goes out, and then the mac amping it on the way in, giving me a buttload more signal than i need, but since i cant find a happy level, i'm not really sure. i really dont want to resort to mic'ing my marshall... even with the volume almost off, my jcm900 is WAY too loud for apartment use. its not like i really NEED the guitar to sound perfect, i only use garageband to sketch out ideas for songs between myself and bandmates, but its really annoying to not have my customary crisp distortion. my bass player keeps telling me to use the built in amps, but, not to dis a practically free program, but the built in amps blow, at least after 10 years of marshall tube amplification they do. if anyone has any suggestions that might be helpfull on how i might resolve this, i would be your best friend for life and go to all your birthday parties

  • Need some help with strange sounds in Logic Pro 8

    Hi!
    I need some help with a problem I have in Logic Pro 8.
    When I have arrange window open, suddley strange high tones starts to make noise in my headphones. I don't know where these sounds comes from or why, but I need some help to get them away. Should I just try to contact Apple?
    Martin

    Hi Martin
    Welcome to the forum. Give everyone here some more info about your set up otherwise it may be difficult to figure out what is wrong.
    Which mac?
    Which OS?
    any hardware devices?
    if you are listening through headphones using the built in audio from the mac, you may be hearing fan noise or a hard drive spin noise.
    Don

  • Error 1603: Need some help with this one

    When installing iTunes I first get an error box saying
    "Error 1406: Could not write value to key \Software\classes\.cdda\OpenWithList\iTunes.exe. Verify that you have sufficient access to that key, or contact your support personnel."
    The second one (after I click on Ignore on the last box) I get it this one:
    "Error: -1603 Fatal error during installation.
    Consult Windows Installer Help (Msi.chm) or MSDN for more information"
    Strange thing is that I do have full access to my computer (or atleast in all other cases I have had since I am the only one with an account on it).
    I have done my best in trying to solve it myself but I'm running out of ideas. I have downloaded latest versions from the website and tried installing Quicktime separately. I have also tried removing Quicktime using add/or remove programs though I just I didn't dare to take full removal because it said something about system files.
    Anyway I really need some help with this, anyone got any ideas?
    Greets,
    Sixten
      Windows XP Pro  

    Do you know how to count backwards? Do you know how to construct a loop? Do you know what an autodecrementor is? Do you know how to use String length? Do you know Java arrays start with index 0 and run to length-1? Do you know you use length on arrays too? Do you know what System.out.println does?
    Show us what you have, there isn't anything here that isn't easily done the same as it would be on paper.

  • I Need Some Help With My Dreamweaver

    Hello, there i need some help with my dreamweaver i already made a forum about this but that one i maded didnt make sense soo i will make it more details in it soo i will tell you what i did i tell you what i downloed and all that just now but i tell you the things what it does i downloaded Adobe Design and Web Premium CS6 its a 30 day trial then and now i will tell you the details look below please
    Details
    Soo i opened my start menu then went on all programs then clicked on Adobe Design and Web Premium CS6 then i clicked on the dreamweaver CS6 then when i clicked on it i heard my computer shut down then it shuted down when i opened it straight away then it turns it self back on
    What did i do about this when it happened?
    I made a question so please can telll me what to do or what ever
    Why did i download it?
    i downloaded it because i am making a website and i want to use dreamweaver CS6 because i use notepad++ i do not like the notepad++ its harder and dreamweaver helps a bit i think because i watched a video of it
    What if you dont have an answer?
    Well, i will be very angry because i am making a good website its gonna be my frist publish website ever i made 20 websites but i never published them i deleted them because i wiped my computer
    What kind of Computer Do You have?
    System:
    Micfosoft windows xp
    Media Center Edition
    Version 2002
    Service Pack 2
    Computer
    ei-system
            intel(R)
    pentium(R) 4 CPU 3.20ghz
    3.20 ghz, 960 MB of RAM
    Btw i am using dreamweaver CS6 if you fogot and dont say add more details because there is alot off details there and if you help me i will show u the whloe code when i am done but leave ur emaill address below
    (C) Connor McIntosh

    No.
    Service Pack 3 just updates your OS. All of your files, folders and programs will still be there.
    You will start running into more problems like this the longer you stick with XP though. That particular OS is over 11 years old, service pack 3 hs been out for over 4 years.
    It may be time for a system upgrade. I personally went from XP to Windows 7 and I haven't looked back one bit.

  • I'm suddenly in need of help with my Firefox browser (6.0.2)

    Hi there,
    I'm suddenly in need of help with my Firefox browser (6.0.2)
    (OS: I use Windows XP).
    When I open up the browser, all I see is a completely blank white screen, with all the toolbars at the top.
    I know that my physical connections are fine: I've tested the modem, turned the pc off and on etc. and I can also receive/send emails.
    This problem started today, 8th September, 2011 and has never happened before.
    Is it a coincidence that Firefox updated itself just before I logged off yesterday evening? Could it be something to do with this particular new update?
    I've also noted that just before I "open up" Firefox, I now get a small box saying:
    [JAVASCRIPT APPLICATION]
    Exc In Ev handl: TypeError: This oRoot.enable is not a function
    This has never appeared before - I hope it offers a clue a to what is wrong.
    The Browser is not stuck in Safe Mode, by the way.
    Obviously, I can't search for any solutions to the problem on the internet, as I can't physically see any websites!
    (A friend is sending this query on my behalf from their pc)
    Any light you could throw on this confusing problem would be much appreciated. I'd rather not have to uninstall and reinstall Firefox if possible.
    If the only option is to uninstall Firefox and reinstall it from your site, then I'm also in trouble (I can't see the internet or make any downloads).
    In that case, would you be able to send the .exe file as an attachment to my email address? If so, please let me know and I'll give you further details.
    Many thanks in advance.

    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    * https://support.mozilla.com/kb/Server+not+found
    * https://support.mozilla.com/kb/Firewalls
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • Please I need some help with a table

    Hi All
    I need some help with a table.
    My table needs to hold prices that the user can update.
    Also has a total of the column.
    my question is if the user adds in a new price how can i pick up the value they have just entered and then add it to the total which will be the last row in the table?
    I have a loop that gets all the values of the column, so I can get the total but it is when the user adds in a new value that I need some help with.
    I have tried using but as I need to set the toal with something like total
        totalTable.setValueAt(total, totalTable.getRowCount()-1,1); I end up with an infinite loop.
    Can any one please advise on some way I can get this to work ?
    Thanks for reading
    Craig

    Hi there camickr
    thanks for the help the other day
    this is my full code....
    package printing;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.text.DecimalFormat;
    public class tablePanel
        extends JDialog  implements Printable {
      BorderLayout borderLayout1 = new BorderLayout();
      private boolean printing = false;
      private Dialog1 dialog;
      JPanel jPanel = new JPanel();
      JTable table;
      JScrollPane scrollPane1 = new JScrollPane();
      DefaultTableModel model;
      private String[] columnNames = {
      private Object[][] data;
      private String selectTotal;
      private double total;
      public tablePanel(Dialog1 dp) {
        dp = dialog;
        try {
          jbInit();
        catch (Exception exception) {
          exception.printStackTrace();
      public tablePanel() {
        try {
          jbInit();
        catch (Exception exception) {
          exception.printStackTrace();
      private void jbInit() throws Exception {
        jPanel.setLayout(borderLayout1);
        scrollPane1.setBounds(new Rectangle(260, 168, 0, 0));
        this.add(jPanel);
        jPanel.add(scrollPane1, java.awt.BorderLayout.CENTER);
        scrollPane1.getViewport().add(table);
        jPanel.setOpaque(true);
        newTable();
        addToModel();
        addRows();
        setTotal();
    public static void main(String[] args) {
      tablePanel tablePanel = new  tablePanel();
      tablePanel.pack();
      tablePanel.setVisible(true);
    public void setTotal() {
      total = 0;
      int i = table.getRowCount();
      for (i = 0; i < table.getRowCount(); i++) {
        String name = (String) table.getValueAt(i, 1);
        if (!"".equals(name)) {
          if (i != table.getRowCount() - 1) {
            double dt = Double.parseDouble(name);
            total = total + dt;
      String str = Double.toString(total);
      table.setValueAt(str, table.getRowCount() - 1, 1);
      super.repaint();
      public void newTable() {
        model = new DefaultTableModel(data, columnNames) {
        table = new JTable() {
          public Component prepareRenderer(TableCellRenderer renderer,
                                           int row, int col) {
            Component c = super.prepareRenderer(renderer, row, col);
            if (printing) {
              c.setBackground(getBackground());
            else {
              if (row % 2 == 1 && !isCellSelected(row, col)) {
                c.setBackground(getBackground());
              else {
                c.setBackground(new Color(227, 239, 250));
              if (isCellSelected(row, col)) {
                c.setBackground(new Color(190, 220, 250));
            return c;
        table.addMouseListener(new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() == 2) {
            if (e.getClickCount() == 1) {
              if (table.getSelectedColumn() == 1) {
       table.setTableHeader(null);
        table.setModel(model);
        scrollPane1.getViewport().add(table);
        table.getColumnModel().getColumn(1).setCellRenderer(new TableRenderDollar());
      public void addToModel() {
        Object[] data = {
            "Price", "5800"};
        model.addRow(data);
      public void addRows() {
        int rows = 20;
        for (int i = 0; i < rows; i++) {
          Object[] data = {
          model.addRow(data);
      public void printOut() {
        PrinterJob pj = PrinterJob.getPrinterJob();
        pj.setPrintable(tablePanel.this);
        pj.printDialog();
        try {
          pj.print();
        catch (Exception PrintException) {}
      public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
        Graphics2D g2 = (Graphics2D) g;
        g2.setColor(Color.black);
        int fontHeight = g2.getFontMetrics().getHeight();
        int fontDesent = g2.getFontMetrics().getDescent();
        //leave room for page number
        double pageHeight = pageFormat.getImageableHeight() - fontHeight;
        double pageWidth =  pageFormat.getImageableWidth();
        double tableWidth = (double) table.getColumnModel().getTotalColumnWidth();
        double scale = 1;
        if (tableWidth >= pageWidth) {
          scale = pageWidth / tableWidth;
        double headerHeightOnPage = 16.0;
        //double headerHeightOnPage = table.getTableHeader().getHeight() * scale;
        //System.out.println("this is the hedder heigth   " + headerHeightOnPage);
        double tableWidthOnPage = tableWidth * scale;
        double oneRowHeight = (table.getRowHeight() +  table.getRowMargin()) * scale;
        int numRowsOnAPage = (int) ( (pageHeight - headerHeightOnPage) / oneRowHeight);
        double pageHeightForTable = oneRowHeight *numRowsOnAPage;
        int totalNumPages = (int) Math.ceil( ( (double) table.getRowCount()) / numRowsOnAPage);
        if (pageIndex >= totalNumPages) {
          return NO_SUCH_PAGE;
        g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    //bottom center
        g2.drawString("Page: " + (pageIndex + 1 + " of " + totalNumPages),  (int) pageWidth / 2 - 35, (int) (pageHeight + fontHeight - fontDesent));
        g2.translate(0f, headerHeightOnPage);
        g2.translate(0f, -pageIndex * pageHeightForTable);
        //If this piece of the table is smaller
        //than the size available,
        //clip to the appropriate bounds.
        if (pageIndex + 1 == totalNumPages) {
          int lastRowPrinted =
              numRowsOnAPage * pageIndex;
          int numRowsLeft =
              table.getRowCount()
              - lastRowPrinted;
          g2.setClip(0,
                     (int) (pageHeightForTable * pageIndex),
                     (int) Math.ceil(tableWidthOnPage),
                     (int) Math.ceil(oneRowHeight *
                                     numRowsLeft));
        //else clip to the entire area available.
        else {
          g2.setClip(0,
                     (int) (pageHeightForTable * pageIndex),
                     (int) Math.ceil(tableWidthOnPage),
                     (int) Math.ceil(pageHeightForTable));
        g2.scale(scale, scale);
        printing = true;
        try {
        table.paint(g2);
        finally {
          printing = false;
        //tableView.paint(g2);
        g2.scale(1 / scale, 1 / scale);
        g2.translate(0f, pageIndex * pageHeightForTable);
        g2.translate(0f, -headerHeightOnPage);
        g2.setClip(0, 0,
                   (int) Math.ceil(tableWidthOnPage),
                   (int) Math.ceil(headerHeightOnPage));
        g2.scale(scale, scale);
        //table.getTableHeader().paint(g2);
        //paint header at top
        return Printable.PAGE_EXISTS;
    class TableRenderDollar extends DefaultTableCellRenderer{
        public Component getTableCellRendererComponent(
          JTable table,
          Object value,
          boolean isSelected,
          boolean isFocused,
          int row, int column) {
            setHorizontalAlignment(SwingConstants.RIGHT);
          Component component = super.getTableCellRendererComponent(
            table,
            value,
            isSelected,
            isFocused,
            row,
            column);
            if( value == null || value .equals("")){
              ( (JLabel) component).setText("");
            }else{
              double number = 0.0;
              number = new Double(value.toString()).doubleValue();
              DecimalFormat df = new DecimalFormat(",##0.00");
              ( (JLabel) component).setText(df.format(number));
          return component;
    }

  • Need some help with a Macally enclosure and a spare internal drive

    Need some help with a Macally enclousure
    Posted: Oct 1, 2010 10:55 AM
    Reply Email
    Aloha:
    I have a Macally PHR-S100SUA enclousure that does not recognise,my WD 1001fals hard drive. It has worked just fine with other internal drives, but not this one?
    This is a spare internal drive that I am trying to make an external drive to store back ups for a lot of data. But so far I can not get it recognized by the computer. Maybe I need different drivers?
    Any suggestions?
    Dan Page

    Hi-
    Drivers aren't typically needed for external enclosures.
    Macally has none listed for that enclosure.
    The same is true for the WD drive, internal or external; no drivers.
    With the exception of high end PM multi drive enclosures, I can't think of any that use drivers.
    How is the external connected?
    Have you tried different cables, different ports?
    Bad/damaged cables are fairly common.
    Have you verified connections inside of the enclosure?

  • Need some help with putting a folder in users directory

    I'm not sure how to do this, but what I want to do is put this file in C:/My Documents, but I need to be able to verify that C://My Documents exists, if not put it in C:/Program Files.
    Can any one help me out?
    try {
                        String[] contactArray = parseDatFile(fc.getSelectedFile());
                        Document document = createXMLDocument(contactArray);
                        saveToXMLFile(
                        document,
                        new File(
                        "C:/Program Files/xxx/",// looks for directory for list
                        "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"));
                    } catch (Exception exc) {
                        File f = new File("C:/Program Files/xxx/");// setting directory for list if not there
                        boolean yes = true;
                        yes = f.mkdir();// creating directory
                        try {
                            String[] contactArray = parseDatFile(fc.getSelectedFile());
                            Document document = createXMLDocument(contactArray);
                            saveToXMLFile(
                            document,
                            new File(
                            "C:/Program Files/xxx/",// used only if the directory didn't exist
                            "xxxxxxxxxxxxxxxxxxxxxxx"));

    Need some help with putting a folder in users directoryI recomend using System.getProperty( "user.home" ) not a hard-coded value.
    This will use the users home folder ( C:\My Documents ) on Win9X (I guess), C:\Documents and Settings\<current user> on Win2K +, and ~ on Unix-a-likes.

  • Need some help with downloading PDF's from the net.

    need some help with downloading PDF's from the net.  Each time I try to click on a link from a website, if it takes me to a new screen to view a pdf, it just comes up as a blank black screen?  any suggestions?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

Maybe you are looking for

  • Converting .wpd documents in Pages '09

    How do you convert .wpd documents produced by word perfect?

  • Error: Assignment to feature PINCH did not take place

    Hello I am trying to do initial data entry using PB10, but the system is throwing an error as "Entry B02 does not exist in T526" (B02 is my personal Administrator) which I have maintained in T526 and when I try to continue removing the Pers Officer,

  • Weblogic 10.3 for Solaris x86

    Where is it available to download ?

  • Safari trouble with Flash Websites

    Hi, I am having trouble using a particular Flash website online that I am developing Using Safari v. 2.0 on a Mac running Tiger 10.4.2 I am able to access the homepage of this site http://www.sweetybomb.com but I am unable to load any of the buttons

  • Why doesn't my iphone 4s volume work?

    I have the iphone 4s, a couple days after updating to ios6.1.3 my volume bar disappeared. sometimes it will come back for a few seconds but my phone does not notify me when i get calls and message. The alarm works and apps do not. It is not water dam