How to write this application - URGENT PLEASE HELP

I would like to write a program for a supermarket loyalty card system. The program should have 2 customers and 2 gifts on offer. The customer details and the gift details can be hard coded.
When the program starts the user should be shown a menu which will have options to
view all customer details
add points for a customer
buy a gift
When the user chooses to buy a gift ro to add points, any changes made to the customers' points must be done using methods. Adding or buying gifts should be done using customer id's and gift id's.
The user must be able to see the altered points.
I WILL APPRECIATE IF I COULD GET HELP EVEN FOR PSEUDOCODE.

Not as much as this guy tho http://forum.java.sun.com/thread.jsp?forum=31&thread=486327&tstart=150&trange=15

Similar Messages

  • Can't delete images with adobe bridge for days , don't know how to fix this , can you please help ?

    Can't delete images with adobe bridge for days , don't know how to fix this ? Can you help please ?

    Thank you so much for sharing

  • My iPad 1st is freezing up when i play games on it, anyone know how to fix this problem? Please Help

    My iPad 1st is freezing up when i play games on it, anyone know how to fix this problem? Please Help

    This is an ipad 2 it hasn't been updated, the thing is I restored it to the orginal setting because it was acting up, instead of 59.9 GB it gave me the memory capacity of 58.9 that has been already been use. Do you think using a different computer that hasn't been use on my ipad will raise the memory capacity? I've done it before just that the computer that I've been using has my ipad's data.

  • How to code this...please help

    Hi Friends:
       Please help me in coding the following scenario:
       I've the following checkboxes on selection screen:
    1. inventory quantity current period-unrestricted (mard-labst)
    2. inventory quantity current period-restricted use stock (mard-einme)
    3. inventory quantity current period-in quality inspection(mard-insme)
    4. inventory quantity current period - blocked (mard-speme)
    5. inventory quantity current period - returns (mard-retme)
    6. inventory quantity current period- stock in transfer (mard-umlme)
    now the scenario is like this. The user may check 1/2/3/4/5/6 checkboxes while executing this program. Now what all checkboxes are checked, only those values to be fetched from MARD. E.g. 1 & 2 are checked. Then I'll fetch labst & einme from MARD. Then I'll add it up. Please help me in coidng this. How to decide it at runtime.
    Thanks:

    Hi use this logic.
    if c1 = 'X.
    select single labst from mard into corrseponding table it_mard where..
    endif
    if c2 = 'X.
    select single einme from mard into corrseponding table it_mard where..
    endif.
    if c3 = 'X.
    select single insmefrom mard into corrseponding table it_mard where..
    endif.
    if c4 = 'X.
    select single spemefrom mard into corrseponding table it_mard where..endif.
    endif
    if c5 = 'X.
    select single retme from mard into corrseponding table it_mard where..
    endif.
    if c6 = 'X.
    select single umlme from mard into corrseponding table it_mard where..endif.
    endif
    Regards,
    Prasad.

  • Why isnt this working urgent please help

    why isnt this working im trying to connect a panel to a scrollpane the panel will contain several dozen text fields
    the scrollpane shouls be about 350, 450 , but the pane is 350
    by 1200 the problem now is that the scorllbar isnt created and even when I explictly create it it contains no knob, and it will
    not scroll up or down please someone help this is urgent
    import java.awt.*;
    import com.sun.java.swing.*;
    public class ScrollDemo extends JPanel {
         private Rule columnView;
         private Rule rowView;
         private ScrollablePicture picture;
         class UnitsListener implements ItemListener {
              public void itemStateChanged(ItemEvent e) {
                   if (e.getStateChange() == ItemEvent.SELECTED) {
                        // Turn it to metric.
                        rowView.setIsMetric(true);
                        columnView.setIsMetric(true);
                   } else {
                        // Turn it to inches.
                        rowView.setIsMetric(false);
                        columnView.setIsMetric(false);
                   picture.setMaxUnitIncrement(rowView.getIncrement());
    public ScrollDemo() {
         Two t = new Two(columnView.getIncrement());
              JScrollPane pictureScrollPane = new JScrollPane(t);
              pictureScrollPane.setPreferredSize(new Dimension(300, 250));
              pictureScrollPane.setColumnHeaderView(columnView);
              pictureScrollPane.setRowHeaderView(rowView);
         public static void main(String s[]) {
              JFrame frame = new JFrame("ScrollDemo");
              frame.setContentPane(new ScrollDemo());
              frame.setVisible(true);
    import java.awt.*;
    import com.sun.java.swing.*;
    public class Two extends JPanel implements Scrollable{
    private JPanel ivjJPanel3 = null;
         private JScrollPane ivjJScrollPane1 = null;
         private int maxUnitIncrement = 1;
    public Two(int m)
         getJPanel1();
         maxUnitIncrement = m;
         setSize(300,1200);
    private void getJPanel1() {
                   setLayout(null);
                   setSize(250,1200);
                   add(getJLabel1(), getJLabel1().getName());
    public Dimension getPreferredScrollableViewportSize() {
              return getPreferredSize();
         public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation,
         int direction) {
              if (orientation == SwingConstants.HORIZONTAL)
                   return visibleRect.width - maxUnitIncrement;
              else
                   return visibleRect.height - maxUnitIncrement;
         public boolean getScrollableTracksViewportHeight() {
              return false;
         public boolean getScrollableTracksViewportWidth() {
              return false;
         public int getScrollableUnitIncrement(Rectangle visibleRect,
                                                      int orientation,
                                                      int direction) {
              //Get the current position.
              int currentPosition = 0;
              if (orientation == SwingConstants.HORIZONTAL)
                   currentPosition = visibleRect.x;
              else
                   currentPosition = visibleRect.y;
              //Return the number of pixels between currentPosition
              //and the nearest tick mark in the indicated direction.
              if (direction < 0) {
                   int newPosition = currentPosition -
                                       (currentPosition / maxUnitIncrement) *
                                       maxUnitIncrement;
                   return (newPosition == 0) ? maxUnitIncrement : newPosition;
              } else {
                   return ((currentPosition / maxUnitIncrement) + 1) *
                        maxUnitIncrement - currentPosition;
         public void setMaxUnitIncrement(int pixels) {
              maxUnitIncrement = pixels;

    I personally didn't play with swing components when they were in the com.sun.java.swing state, but I have a strong feeling it is very buggy and could be causing your problem.
    Before posting gui issues, please use a newer API, even jdk1.1 would be fine, anything would be better than what your using.
    you wrote: I dont care if its javax.swing or
    com.sun.java.swing
    I would also gather from this statement that your attitude could be one of your other issues.

  • This is urgent please help!  long running job in sm37 but not in sm66

    Hi,
    Can someone please help for an explanation as to why if you call sm37, you can see that the job is long running (example about 70,000 sec), but when you look at the PID where the job is running in sm66 it does not show 70,000 sec but only around 6,000 sec.
    Can someone please explain why?  Thank you very much

    For background processes, additional information is available for the background job that is currently running. You can only display this information, if you are logged onto the instance where the job is running, or if you choose Settings and deselect Display only abbreviated information, avoid RFC. In any case, the job must still be running.
    Regards
    Anilsai

  • How to solve this trouble ? Please help me !

    Hi everyone ! I'm fresher in c and c++. I'm having a trouble when I add new data into vector / list . I have a method like :
    void List(vector<Student> &result)
    ifstream list(saveurl, ios::in | ios::binary);
    if (list.is_open())
    Student st;
    while (!list.eof())
    if (list.read((char*)&st, sizeof(Student)))
    result.push_back(st);
    list.close();
    First-chance exception at 0x5E84DF58 (msvcp120d.dll) in Student.exe: 0xC0000005: Access violation reading location 0x010FAA4C.
    If there is a handler for this exception, the program may be safely continued.
    what can I do now ? any suggestions for me ?

    On 17/03/2015 20:31, "Tran Hoang Duc" wrote:
    as shown below is how is the Student class defined .
    struct DateTime
    int day,month,year;
    class Student
    private :
    __int64 RollNo;
    string StudentName, Course, FatherName,Address,Country;
    DateTime DateofBirth;
    is it right ?
    Perfect, as I suspected :)
    Your Student class definition is just fine.
    The problem is how you serialize that to/from files.
    Since you have non-POD types like std::string as Student data members, you can't just dump your Student internal bytes to disk and read them back to disk.
    This won't work, because for example std::string has pointers inside, and the values of those pointers (memory addresses) are meaningless when you write them to file and later load them from file, as just raw bytes, like in this code showed above in
    this thread:
    Student st;
    while(list.read((char*)&st, sizeof(Student)))
     You have to think how to write your Student class to files.
    You can use XML, JSON, or even simple comma separated values text files.
    Even if you use some custom binary format for your Student instances, you should pay attention to properly write the text stored in your strings to files, and read that back into std::string data members.
     Giovanni

  • I have had creative cloud for a while now and suddenly indesign dissapeared off of my macbook pro and now won't install again! This is urgent please help.

    I checked its been uninstalled from my mac and then every time I reinstall it, it just perpetually sits on that page that says 'inDesign is downloading now'... but it never does. Need urgent help please! Photoshop and illustrator remained on my mac no issue there. Whats going on?...

    Musecatherine please begin the installation process in the Creative Cloud Desktop application.  You can find details on how to install the Adobe Creative applications, included with your membership, at Install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html.
    It is likely that the AAM Detect Plug-in is not installed or blocked by your current web browser.  This is why no action occurs when you are on the download page.

  • DEAL OR NO DEAL HELP THIS IS URGENT PLEASE HELP ME!!!!!

    i have a project due in two days and i must create a deal or no deal game in java the following is the code i have currently created i am not very advanced so this is where i am at so far:
    // The "DealorNoDeal" class.
    import java.awt.*;
    import hsa.Console;
    import java.util.Random;
    public class DealorNoDeal
        static Console c;
        public static void main (String[] args)
            c = new Console (30, 110, 15, "DEAL OR NO DEAL");
            //setSize(500,500);
            double[] CasesValues = {.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750, 1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 750000, 1000000};
            double[] Case = new double [26];
            int number = 0, Choosen, Remove = 0, Offer = 0;
            double PlayerCase;
            Random generator = new Random ();
            boolean Picked = false;
            char Deal = ' ';
            boolean Not = false;
            String name;
            // USER ENTERS THEIR NAME
            c.println ("Please enter your name: ");
            name = c.readString ();
            c.println (" ");
            // THIS PUTS THE NUMBERS IN THEIR CASES
            for (int i = 1 ; i < 26 ; i++)
                number = generator.nextInt (26);
                Case = CasesValues [number];
    for (int i = 0 ; i < 13 ; i++)
    c.println (CasesValues [i] + "\t\t" + CasesValues [i + 13]);
    // THE USER CHOOSES THEIR CASE
    c.println ("Please Pick Your Case");
    Choosen = c.readInt ();
    PlayerCase = Case [Choosen];
    c.clear ();
    // THE USER PICKS 6 CASES TO REMOVE
    for (int x = 1 ; x < 7 ; x++)
    c.print ("Please Choose Case To Remove: ");
    Remove = c.readInt ();
    for (int i = 1 ; i < 26 ; i++)
    if (Remove == i)
    c.clear ();
    c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
    Case [i] = 0;
    c.println ();
    c.print ("Case Numbers Picked: ");
    for (int i = 1 ; i < 26 ; i++)
    if (Case [i] == 0)
    c.print (" " + i);
    c.println ();
    // CALCULATES AND MAKES OFFER
    for (int i = 1 ; i < 26 ; i++)
    Offer += Case [i];
    Offer = Offer / 19;
    c.clear ();
    c.println ("The Offer is: " + Offer);
    c.println ("DO YOU ACCPET (Y/N)");
    Deal = c.readChar ();
    if (Deal == 'Y' || Deal == 'y')
    c.clear ();
    c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
    else if (Deal == 'N' || Deal == 'n')
    c.println ("ALRIGHT NOW YOU MUST OPEN 5 CASES");
    // THE USER PICKS 5 CASES TO REMOVE
    for (int x = 1 ; x < 6 ; x++)
    c.print ("Please Choose Case To Remove: ");
    Remove = c.readInt ();
    for (int i = 1 ; i < 26 ; i++)
    if (Remove == i)
    c.clear ();
    c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
    Case [i] = 0;
    c.println ();
    c.print ("Case Numbers Picked: ");
    for (int i = 1 ; i < 26 ; i++)
    if (Case [i] == 0)
    c.print (" " + i);
    c.println ();
    // CALCULATES AND MAKES OFFER
    for (int i = 1 ; i < 26 ; i++)
    Offer += Case [i];
    Offer = Offer / 14;
    c.clear ();
    c.println ("The Offer is: " + Offer);
    c.println ("DO YOU ACCPET (Y/N)");
    Deal = c.readChar ();
    if (Deal == 'Y' || Deal == 'y')
    c.clear ();
    c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
    else if (Deal == 'N' || Deal == 'n')
    c.println ("ALRIGHT WE WILL CONTINUE TO OPEN CASES");
    // THE USER PICKS 4 CASES TO REMOVE
    for (int x = 1 ; x < 5 ; x++)
    c.print ("Please Choose Case To Remove: ");
    Remove = c.readInt ();
    for (int i = 1 ; i < 26 ; i++)
    if (Remove == i)
    c.clear ();
    c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
    Case [i] = 0;
    c.println ();
    c.print ("Case Numbers Picked: ");
    for (int i = 1 ; i < 26 ; i++)
    if (Case [i] == 0)
    c.print (" " + i);
    c.println ();
    // CALCULATES AND MAKES OFFER
    for (int i = 1 ; i < 26 ; i++)
    Offer += Case [i];
    Offer = Offer / 10;
    c.clear ();
    c.println ("The Offer is: " + Offer);
    c.println ("DO YOU ACCPET (Y/N)");
    Deal = c.readChar ();
    if (Deal == 'Y' || Deal == 'y')
    c.clear ();
    c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
    else if (Deal == 'N' || Deal == 'n')
    c.println ("ALRIGHT WE WILL CONTINUE BY OPENING 3 CASES");
    // THE USER PICKS 3 CASES TO REMOVE
    for (int x = 1 ; x < 4 ; x++)
    c.print ("Please Choose Case To Remove: ");
    Remove = c.readInt ();
    for (int i = 1 ; i < 26 ; i++)
    if (Remove == i)
    c.clear ();
    c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
    Case [i] = 0;
    c.println ();
    c.print ("Case Numbers Picked: ");
    for (int i = 1 ; i < 26 ; i++)
    if (Case [i] == 0)
    c.print (" " + i);
    c.println ();
    // CALCULATES AND MAKES OFFER
    for (int i = 1 ; i < 26 ; i++)
    Offer += Case [i];
    Offer = Offer / 7;
    c.clear ();
    c.println ("The Offer is: " + Offer);
    c.println ("DO YOU ACCPET (Y/N)");
    Deal = c.readChar ();
    if (Deal == 'Y' || Deal == 'y')
    c.clear ();
    c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
    else if (Deal == 'N' || Deal == 'n')
    c.println ("ALRIGHT," + name + "YOU MUST CHOOSE 2 CASES TO OPEN NOW");
    // THE USER PICKS 2 CASES TO REMOVE
    for (int x = 1 ; x < 3 ; x++)
    c.print ("Please Choose Case To Remove: ");
    Remove = c.readInt ();
    for (int i = 1 ; i < 26 ; i++)
    if (Remove == i)
    c.clear ();
    c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
    Case [i] = 0;
    c.println ();
    c.print ("Case Numbers Picked: ");
    for (int i = 1 ; i < 26 ; i++)
    if (Case [i] == 0)
    c.print (" " + i);
    c.println ();
    // CALCULATES AND MAKES OFFER
    for (int i = 1 ; i < 26 ; i++)
    Offer += Case [i];
    Offer = Offer / 5;
    c.clear ();
    c.println ("The Offer is: " + Offer);
    c.println ("DO YOU ACCPET (Y/N)");
    Deal = c.readChar ();
    if (Deal == 'Y' || Deal == 'y')
    c.clear ();
    c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
    else if (Deal == 'N' || Deal == 'n')
    c.println ("ALRIGHT," + name + "YOU MUST CHOOSE 1 CASE TO OPEN NOW");
    // THE USER PICKS 1 CASES TO REMOVE
    for (int x = 1 ; x < 2 ; x++)
    c.print ("Please Choose Case To Remove: ");
    Remove = c.readInt ();
    for (int i = 1 ; i < 26 ; i++)
    if (Remove == i)
    c.clear ();
    c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
    Case [i] = 0;
    c.println ();
    c.print ("Case Numbers Picked: ");
    for (int i = 1 ; i < 26 ; i++)
    if (Case [i] == 0)
    c.print (" " + i);
    c.println ();
    // CALCULATES AND MAKES OFFER
    for (int i = 1 ; i < 26 ; i++)
    Offer += Case [i];
    Offer = Offer / 4;
    c.clear ();
    c.println ("The Offer is: " + Offer);
    c.println ("DO YOU ACCPET (Y/N)");
    Deal = c.readChar ();
    if (Deal == 'Y' || Deal == 'y')
    c.clear ();
    c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
    else if (Deal == 'N' || Deal == 'n')
    c.println ("ALRIGHT," + name + "YOU MUST CHOOSE 1 CASE TO OPEN NOW");
    // THE USER PICKS 1 CASES TO REMOVE
    for (int x = 1 ; x < 2 ; x++)
    c.print ("Please Choose Case To Remove: ");
    Remove = c.readInt ();
    for (int i = 1 ; i < 26 ; i++)
    if (Remove == i)
    c.clear ();
    c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
    Case [i] = 0;
    c.println ();
    c.print ("Case Numbers Picked: ");
    for (int i = 1 ; i < 26 ; i++)
    if (Case [i] == 0)
    c.print (" " + i);
    c.println ();
    // CALCULATES AND MAKES OFFER
    for (int i = 1 ; i < 26 ; i++)
    Offer += Case [i];
    Offer = Offer / 3;
    c.clear ();
    c.println ("The Offer is: " + Offer);
    c.println ("DO YOU ACCPET (Y/N)");
    Deal = c.readChar ();
    if (Deal == 'Y' || Deal == 'y')
    c.clear ();
    c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
    else if (Deal == 'N' || Deal == 'n')
    c.println ("ALRIGHT," + name + "YOU MUST CHOOSE 1 CASE TO OPEN NOW");
    // THE USER PICKS 1 CASES TO REMOVE
    for (int x = 1 ; x < 2 ; x++)
    c.print ("Please Choose Case To Remove: ");
    Remove = c.readInt ();
    for (int i = 1 ; i < 26 ; i++)
    if (Remove == i)
    c.clear ();
    c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
    Case [i] = 0;
    c.println ();
    c.print ("Case Numbers Picked: ");
    for (int i = 1 ; i < 26 ; i++)
    if (Case [i] == 0)
    c.print (" " + i);
    c.println ();
    // CALCULATES AND MAKES OFFER
    for (int i = 1 ; i < 26 ; i++)
    Offer += Case [i];
    Offer = Offer / 2;
    c.clear ();
    c.println ("The Offer is: " + Offer);
    c.println ("DO YOU ACCPET (Y/N)");
    Deal = c.readChar ();
    if (Deal == 'Y' || Deal == 'y')
    c.clear ();
    c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
    else if (Deal == 'N' || Deal == 'n')
    c.println ("NOW ITS TIME TO OPEN ONE MORE CASE");
    // THE USER PICKS 1 CASES TO REMOVE
    for (int x = 1 ; x < 2 ; x++)
    c.print ("Please Choose Case To Remove: ");
    Remove = c.readInt ();
    for (int i = 1 ; i < 26 ; i++)
    if (Remove == i)
    c.clear ();
    c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
    Case [i] = 0;
    c.println ();
    c.print ("Case Numbers Picked: ");
    for (int i = 1 ; i < 26 ; i++)
    if (Case [i] == 0)
    c.print (" " + i);
    c.println ();
    // CALCULATES AND MAKES OFFER
    for (int i = 1 ; i < 26 ; i++)
    Offer += Case [i];
    Offer = Offer / 2;
    c.clear ();
    c.println ("The Offer is: " + Offer);
    c.println ("DO YOU ACCPET (Y/N)");
    Deal = c.readChar ();
    if (Deal == 'Y' || Deal == 'y')
    c.clear ();
    c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
    else if (Deal == 'N' || Deal == 'n')
    c.println ("NOW ITS TIME TO OPEN YOUR CASE, YOUR CASE CONTAINED " + (Offer * 2) + " DOLLARS");
    i would really appreciate it if you could show me how to tell the player when they have already chose a case and not let them choose it again and if possible have all the values display and eliminate the values as they the cases are opened my e-mail is [email protected] if you can e-mail there or add me on msn it would be really appreciated also for future reference thanks

    Why is everybody on this thread so violent.Nobody was violent.
    Just to address my first posts.
    1) The subject line is very annoying
    2) Asking for people to email you is not on
    3) The code is crap. It's unbearable lengthy and the more I looked at it the more I cringed. As you yourself noted in your reply more methods would be a good start. Even if hero were to get the program in it's current form to work then as a grade it gets no better than a D and possibly an F anyway.
    So while I think encouragement is fine and noble there are sometimes you have to call a spade a spade. The OP (_hero_) if he wants help here needs to be prepared to interact on the forum in a communally acceptable fashion (see 1 and 2) and to start from scratch with his code (see 3). While this may not be what the OP wanted to hear playing pollyanna about it is counter-productive.
    All I did was give my advice to the guy and now IM
    getting torn to pieces by prometheuzzzzzzz and
    marcrules.
    Look:
    1) I taught myself Java and I didn't learn the
    conventions properly (at all).
    2) I can't indent code directly in the java forum
    message editor.
    3) When I write my posts I often dont test them
    because they're pseudo-code so they dont need to be
    made in Eclipse or JCreator or w/e.There is a lot of whining going on here. Just take the advice given for what it is worth. Learn conventions. Start indenting. Stop using an IDE (for now).
    Above all stop taking it so personally. If you post code that is crap on this site more often then not someone will point it out. Subtly or un-subtly as the case may be.
    4) Stop being so violent towards people when they're
    asking for helpAgain see my previous points. Nobody was violent to anyone. Further the OP needs a wakeup call.
    >
    Does that explain why i code as i do?Not really.

  • Noob question, how to avoid this runtime error,please help..

    Im new to java. Im using a JOptionPane in getting the user an input/a number, which is in String,. and to use it, im converting it by Integer.parseInt. When I run it everything seems ok, but whenever i inputted other data types other than integer(e.g char), i get a runtime error message "exception in main thread java.lang.NumberFormatException blah blah.....,. Is theres a way or a method or something that i can filter the users input when they type a character or when they inputted nothing that will not resulted to a runtime error, instead, an error message box will said that it is an invalid input. thanks in advance

    Ah, well, after an evening of rest and reflection, I have to conclude that we are all partially correct. I never meant to imply that NumberFormatException should not be caught. I have had to repair too many classes in which just-in-case or programming-by-exception was a rule, rather than a valuable technique for handling exceptional or error situations.
    As far as this example, I was not attempting to write a parser, or even start one. We are talking about a very simple situation ... determine if a String represents an integer. My example was overly simple, too. As pointed out, too simple. *\d+* would have eliminated empty strings, and with a few relatively minor changes, could handle all legal integers easily, including '-' and ',' characters, while excluding floating point and other invalid inputs. I did mention that regexes were an advanced technique. A Scanner could be used to test for the existence of an integer in a string. None of these rise to the level of parsing, IMO, but, as I have frequently said in these fora, the arguments of the mages are infinite. Of course, that implies that I consider myself a mage, which is not actually the truth.
    In any case, as pointed out, this is an example where catching a runtime exception is probably a good idea, as long as we don't give the OP the idea that this is the only technique, or that code can be written to ignore the causes of exceptional situations, because we can always handle them in the catch block. I have seen way too much of this to be comfortable with even the suggestion of this.
    I come here to learn. Sometimes, I learn interesting, complex things. Sometimes, I learn interesting, simple things.
    Sincerely, thanks for helping me to learn.
    ? {?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to handle this error!(please help)

    hey !
    i am getting this error massege(cannot resolve the symbol(setBorder).i am really confused .
    please somebody help me!
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.text.SimpleDateFormat;
    //import javax.swing.border.CompoundBorder;
    class MyPanel extends Grid
    public MyPanel()
    public MyPanel(String title)
    setBorder(BorderFactory.createCompoundBorder(
    BorderFactory.createTitledBorder(title),
    BorderFactory.createEmptyBorder(5,5,5,5)));
    public class Grid extends JFrame /*implements ActionListener*/
    static final int FPS_INIT = 15; //initial frames per second
    static final int FPS_INIT2=2000;
    //THIS LINE
    //static final double FPS_INIT3=Aug;
    int intframeNumber = 0;
    int delay;
    boolean frozen = false;
    private JPanel date_panel,year_panel, month_panel,day_panel;
    private String time=new String("");
    private Date date=new Date();
    public Grid() {
    time=time + new Date().toString();
    SimpleDateFormat formatter = new SimpleDateFormat("E, MMMM d, yyyy") ;
    time = formatter.format(date) ;
    date_panel=new JPanel();
    year_panel=new JPanel();
    month_panel=new JPanel();
    day_panel=new JPanel();
    JSlider framesPerSecond = new JSlider(JSlider.HORIZONTAL,
    1, 31, FPS_INIT);
    JSlider framesPerSecond2 = new JSlider(JSlider.HORIZONTAL,
    1990, 2010, FPS_INIT2);
    //THIS LINE
    // JSlider framesPerSecond3 = new JSlider(JSlider.HORIZONTAL,
    // Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec, FPS_INIT3);
    date_panel.setLayout(new FlowLayout());
    date_panel.add(new JLabel(time));
    day_panel.setLayout(new FlowLayout());
    day_panel.add(framesPerSecond);
    //year_panel.setLayout(new FlowLayout());
    MyPanel year_panel = new MyPanel("Year");
    year_panel.setLayout(new BorderLayout());
    month_panel.setLayout(new FlowLayout());
    // month_panel.add(framesPerSecond3);
    // JSlider framesPerSecond = new JSlider(JSlider.HORIZONTAL,
    // 0, 31, FPS_INIT);
    // framesPerSecond.addChangeListener(new SliderListener());
    //Turn on labels at major tick marks.
    framesPerSecond.setMajorTickSpacing(5);
    framesPerSecond.setMinorTickSpacing(1);
    framesPerSecond.setPaintTicks(true);
    framesPerSecond.setPaintLabels(true);
    framesPerSecond.setBorder(
    BorderFactory.createEmptyBorder(0,0,10,0));
    framesPerSecond2.setMajorTickSpacing(5);
    framesPerSecond2.setMinorTickSpacing(1);
    framesPerSecond2.setPaintTicks(true);
    framesPerSecond2.setPaintLabels(true);
    framesPerSecond2.setBorder(
    BorderFactory.createEmptyBorder(0,0,10,0));
    year_panel.add(framesPerSecond2);
    /* framesPerSecond3.setMajorTickSpacing(2);
    framesPerSecond3.setMinorTickSpacing(1);
    framesPerSecond3.setPaintTicks(true);
    framesPerSecond3.setPaintLabels(true);
    framesPerSecond3.setBorder(
    BorderFactory.createEmptyBorder(0,0,10,0));*/
    //JPanel contentPane = new JPanel();
    //Create the label for the animation.
    // picture = new JLabel(new ImageIcon("images/doggy/T"
    // + frameNumber
    // + ".gif"),
    // JLabel.CENTER);
    Container contentPane = getContentPane();
    contentPane.setLayout(new GridLayout(4,4));
    contentPane.add(date_panel);
    contentPane.add(year_panel);
    contentPane.add(day_panel);
    // contentPane.add(month_panel);
    public static void main(String args[]) {
    Grid gw = new Grid();
    gw.setTitle("Date Slider");
    gw.setSize(400,200);
    gw.setVisible(true);

    you have to set the border for ur component, u can not call set border on the air..........
    i have changed your code like this
         year_panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(title),BorderFactory.createEmptyBorder(5,5,5,5)));
    and
                                  public JPanel date_panel,year_panel, month_panel,day_panel;
    instead of private i have used public.It is compiling.

  • I have an ipad 64GB, I'm trying to restore it to the orginal memory capacaity of 59.9 GB when I first go it. Does anyone know how to solve this problem? Please help!!!!

    I have an ipad 64 GB I'm trying to restore it to it's orginal memory capacaity of 59.9 just like when I got it, Can anyone help me find the solution and help me fix it?

    This is an ipad 2 it hasn't been updated, the thing is I restored it to the orginal setting because it was acting up, instead of 59.9 GB it gave me the memory capacity of 58.9 that has been already been use. Do you think using a different computer that hasn't been use on my ipad will raise the memory capacity? I've done it before just that the computer that I've been using has my ipad's data.

  • When i'm typing google in the search column .. its giving some other files path in c drive .. i cant that file in my desktop too , i have uninstalled that software too . how to fix this problem ? please help me out.

    Hello Help Desk,
    I am facing problem , When i am typing google.com in my url its showing like this in url's place
    file:///C:/Users/acer/AppData/Roaming/GmailHackerPro/GmailHackerPro/1.0.0.0/MyGoogle.html
    can u help me to fix this problem
    Even i can't find those files in my C drive

    I would try to uninstall that extension GMail Hacker Pro and reset the keyword.URL in your about:config

  • HT201209 i have problem with my billing information, every time when i want buy app from app store, he told me go to purchase history , i don't know how i fix this problem, so please help me

    Dear
       I Have a problem with purchases , where , when i wanna buy a game from app store (Using VISA), he told me : your billing information was decline,
    So Please i need your support to solve the problem quickly
    Thanks
    Ali Altalabany

    Try rebooting the iPad one more time. Try using recovery mode again and if that still doesn't work, make an appointment at an Apple Store and ask for their help.
    iOS: Unable to update or restore - Apple - Support

  • Tv tuner problem!!!!  this is urgent please help....

    Hi,
    I'm trying to capture vidfeo from tv tuner I've done it before with several kinds of tuners
    I'm using " Ati All In Wonder 128 " -display adapter with tv tuner- now and it is giving strange colors on JMF
    studio although it runs fine on Ati software
    any help will be good even any wild guesses will be helpful
    duke

    thanks for your reply
    this problem is fixed now after I captured another format UYVY instead of YUV
    but there is a nother problem if capture with 16 pits per pixel the screen is fine but with 24 a thick black line is at the top of the screen
    the problem is I can change the pits per pixel parameter in jmf studio
    but in my code
    I query the CaptureDeviceManager with a VideoFormat object (it has no way to set the pits per pixel)
    and it is giving the black line
    and when I try to query the CaptureDeviceManager with RGBFormat object to set teh pits per pixel
    It returns a 0 length array of capture device info
    are you familiar with such a problem
    thanks in advance

Maybe you are looking for