I need someones honest opinion about my classe's lab final

hello, my name is Professor John Mane, i am teaching AP java in a high school and would like to know if anyone thinks that this would be good for the lab final- i would like to know if anyone can do it and if can, how long it takes you to do it,
thank you
Write a class whose ultimate purpose is to either sum al the numbers or take the product of all numbers between 2 limits, skipping numbers, if desired, at regular intervals. The user is given the opportunity to specify the operation (sum or multiply), the limits (either decreasing to increasing or increasing to decreasing), and the skip interval (for example the user wants to sum every third number between 2 and 9 = 2 + 5 + 8 = 15). The user is also given the option to either add or multiply this calculated value to the previously calculated result. At the conclusion of the operation, the user is asked if (s)he wants to continue or to terminate the program. If continue is the option, the whole process begins again.
There will be a test program whose only job will be to create an object which is an instance of this class and to print out �job completed x times� (where x indicates the number of calculations performed) after the user elects to terminate. It is required that the class have a constructor, a public method to process input and control the flow of execution from the user�s point of view, and non � public methods to do the calculation and print out the results (when invoking a method from within a class, no object or class needs to be provided; just supply the name of the method).
I plan to begin grading on december 30th, so i would like to know if anyone out there can do this- and if can please send me the finished project- my email is [email protected]

bsampieri: yes, it's a ploy. Even assuming a teacher had decided to wait until this late in the semester to come up with an assignment, do you really think they would've decided on when they wanted to start grading it rather than, you know, when they would assign it?
Also, who introduces themselves as "my name is Professor John Mane"? For that matter, why would someone with the title "professor" be teaching an "AP Java" (high school) class?
And isn't "AP Java" really "AP Computer Science"? This doesn't really prove he or she isn't a professor as much as it proves that he or she is a dolt who doesn't even know the name of the class.
Let's see, there's also the aforementioned fact that "send me the finished project" is inconsistent with the desire to see "if it's a good lab final". If he or she is really a professor, they should have no problem actually doing it themselves. And if they can't do it themselves, they really shouldn't be assigning it to kids just learning the language.
I'd add that teachers wouldn't tend to give an assignment like this due over the holidays, but apparently this guy's teacher is enough of an arse to do that very thing. Unless the OP is giving themselves enough time to customize the code so that a google search for it won't find this thread.
I sincerely hope no one answers this jackanape, so that he or she will have wasted all the time coming up with this elaborate scheme and still fail his or her assignment.

Similar Messages

  • I need an honest opinion on whether or not to buy a macbook now

    Here's the deal-- I'm going to college in 4 weeks. I was really looking forward to finally buying a new computer-- my first laptop, my first Mac. I've been following developments in the Macbook line, reading these forums on and off, and I would like your honest opinion: should I buy a Macbook in the next two weeks or so, or do you think that it has too many problems to warrant paying 1500+ dollars?
    I'm also going to college in a rather rural location, pretty far away from an Apple Store, so if problems do crop up, I would be basically relying on phone tech support.
    My main worry are these reports of Macbooks shutting down without warning. I intend to use this computer for everything, including writing papers, and just the thought of my computer shutting down like that gets me frustrated.
    So, do you think Apple has been working to fix these problems that people have been reporting? If you've recently bought a Macbook, are you happy with it? Should I go for this product, or wait until next summer or this Christmas, whenever they release the second generation? (Does anyone have any idea when that will happen, from past product release cycles?)
    Thank you for your advice.

    Hi there!
    I just recently bought my first mac, a white Macbook 2.0 Ghz. I am one of those unfortunate souls who happened to get a mac which turns yellow due to sweet...you can imagine how ****** I was when I noticed the discoloration and read about the problem on these forums. Taking into consideration the money I paid, the problem I am facing, and the fact that its my first mac, I think you can accept my opinion as honest.
    I say go for it. Even with the unsolved problem I have at the moment I love my mac. Its extremly practical, so easy to use and ever since I got the nack of it I've been encouraging all my friends to switch. When I purchased I was thinking of maybe selling it if I don't like it or getting windows, but I did neither. How long did it take to get the nack of it? I called a friend after I purchased and asked him to give me some tips. He said the most important is "always think of an easier solution, then in windows". He was so right Once i sat over a problem I had for 30 minutes trying to figure out what to do. Finally I searched these forums and than beat myself with a blunt object when I realized how simple it would have been to do what I was trying to. My friends make fun of me and say I praise mac so much I should work at their PR office.
    I wouldn't worry about not being close to a store, because as many people mention on these forums also, using phone assistance is often better. Unless your talking to a genious, people in the store say the stupidest things sometimes...I am going to get my discoloration problem solved over the phone also, its much quicker than talking it to a store, even though I am in NY!
    The only reason I think you may want to wait, is because supposedly the new os is coming out in august and you may want to get a mac with the new software, if its only a matter of weeks, but gets some info on that from others, cause I am not sure about the exact release date etc.
    Hope all goes well
    All the best
    Rob

  • I need someone help me about "Call Failed".

    Excuse me. I live in Taiwan and my english is poor.
    I have a strange problem.
    When I receive a phone call or call out, I press the "Speaker" to talk then my phone shows "Call Failed" every time.
    I try to restore my phone, but the "Speaker" still don't work.
    Is this the firmware or hardware problem?
    Have someone the same problem?
    (My phone is iPhone 3G 16GB, Model MB500T, Version 2.2.1, Modem Firmware 02.30.03)
    Please, I need your help.

    I live in Taiwan, but I bought the iPhone in Italy.
    So the agent of Taiwan don't fix or replace it.
    I feel so sadly.

  • Need some honest opinions about Campus VPNs - MPLS in the Enterprise

    Our organization is considering the new Cisco Campus VPN model for one of our new research facilities (~1000 people). They are suggesting a Layer 3 MPLS-iBGP-VPN Core and Distribution Layer (between the PEs) and Layer 2 at the Access. This seems unnecessarily complex and rather difficult to manage. We're going to end up with anywhere from 30-50 VRFs, and we'll end up having to place 6500s w/Sup 720s everywhere (even at the Access). This sounds like overkill to me. Thoughts?

    It basically reads like I wrote a paper describing what I've been thinking about. ;)
    So I guess that means I like the architecture as a general rule. My question to some degree still stands regarding what it is you want and what you need for your environment.
    If you really need the kind of services afforded by this design, then there's not much else you can do that's scalable.
    However, I noticed when the Superverisor 32 came out that it mentioned future MPLS support. I don't know what timeframe the necessary software will come out in (or if it's out already), but depending on the timeframe for your implementation it may be possible for them to coincide in some beneficial way. That would certainly save you rather a lot of money I suspect, as the Sup32s are quite a bit less expensive than the Sup720s (particularly if you're considering having two in each chassis for redundancy). Like I said, I have no idea about availability, but it may be something to consider if you can weasel some dates out of your Cisco salesman (or woman).

  • Honest Opinion about Metalink3 replacing Customer Connection

    I had a look at metalink3, and as a PeopleSoft Customer Connection user, I would definitely not log in to that site again.
    Its by far the worst possible solution that Oracle has implemented...
    Honest Opinions PLEASE

    You are right, it is becoming very painful to find something helpful through the knowledge tab. We should be able to expend the subject and see the subtitel without going inside, means often we have to go up and choose an other link if the first was wrong.
    I don't know, but it seems the new design of the Oracle supports are not for technical people who wants fast search, and clear information.
    By the new site, nothing help in that way.
    One more thing is the search of product, no list, we are force to put something which exactly match to whatever exists...
    Let's see by the coming Friday how Peoplesoft will be entirely intregated into Metalink3, but seems hopeless to get a better interface.
    Nicolas.

  • Need someone to clarify about weblogic connection vs actual db session

    Hi,
    I'm working on CRM Application which working on Weblogic application server. But I have some confusion between number of connection in monitoring tab( picture from this link [http://postimg.org/image/nbmjncq2n/]) and actual number session that I capture from DBA.
    from the picture, the highest number of connection in weblogic is just 5 but when DBA capture active connection to me, it show like 400 active connections. Anyone can explain the relationship between this 2 values. Is it related or not?
    Thank you
    kumpol

    Post this question in the JDBC forum for fast response.

  • We have been loyal Verizon customers for about six years and need someone to investigate the amount of stress we have been put through by them in the last two or three weeks!HELP!Who do we go to?

    We have been loyal Verizon customers for about six years and need someone to investigate the amount of stress we have been put through by them in the last two or three weeks!HELP!Who do we go to?

    What problem are you having with your service or device? (Removed)
    Message edited as required by the Verizon Wireless Terms of Service
    Message was edited by: Admin Moderator

  • Need you opinion about my website

    Hello I need an opinion about my new website:
    http://www.logoarena.com
    thanks!

    I think so cool & excellent !!
    Please, comment my web site
    相続税 所得税 法人税

  • Need help about Vector class in java

    Hello,
    I have some questions about Vector class. Please see this short code:
    Vector v = new Vector();
    v.add(New Integer(5));
    Is this the only way to add int value into vector? Performance wise, is this slow? And are there any better and faster way to add/get int element fro vector?
    Thank you very much in advance.

    Normally (up to Java version 1.4), that's the only way you can add an int to a Vector. The thing is that Vector can only contain Objects, and an int is a primitive, not an object. So you have to wrap the int in an Integer object.
    However, Java 5 has a new feature, called autoboxing, which means that the compiler automatically wraps primitive values into objects, so that you can program it like this:
    Vector v = new Vector();
    v.add(5);Note, this will not make your program faster or more efficient, because the compiler translates this automatically to:
    Vector v = new Vector();
    v.add(new Integer(5));So in the end, the same bytecode will be produced. Autoboxing is just a feature to make life more convenient for the programmer.

  • Need honest opinion :)

    Hey guys need some honest opinions here. I want to get 2 of the MSI lightning 7970's. Well I was also looking @ the powercolor HD 7970 vortex ll it has a nice core clock of 1100MHZ and 1425 memory. The msi lightning has 1070 mhz and 1400MHZ, now according to actual MHZ specs the powercolor is faster, but we all know the MSI is faster. Well I can get the powercolor for almost $100 cheaper its $399 vs $489 MSI. I need a new case and buy going with the power color I can get the one i want because I save almost $200.00, if I go with the MSI it will be a while beofer i can get the case I want but I really do need one know, I currently use a alienware aurora R3 and cards will be sandwhiched to tight, so i really need a case. What are your guys thoughs of the powercolor vortex card?

    This is a MSI forum and we can't discuss or recommend products competing with MSI products anyway.
    The MSI Radeon 7970 Lightning is a great card. It features a way advanced custom MSI PCB with the unique GPU reactor (an add-on PCB that holds additional tantalum capacitors, which helps providing power for the GPU in extreme situations). It also offers the unique triple overvolting feature when using MSI Afterburner.
    The Lightning would therefor be a perfect choice after all.

  • Honest opinion on the iphone

    due to this new "price drop" im considering getting an iphone. im a student and couldnt get myself to spend $600 on a phone but now its a little more manageable. i cant really comprehend what the iphone actually has wrong with it. it seems like the people who talk bad about it are the people who dont have one. i need to know the truth about what works and what doesnt. i have a mac so i dont have to deal with that crappy windows corresponding junk.
    i just wanna know from people that actually have one. i hear about all these "problems" and it makes me a little weary. ive been to the store and played with the phone many times and it seems really amazing.
    so i guess the real question is... is it worth it???
    and when you are texting can you turn the phone and have the keyboard horizontal while composing texts??

    Definitely not worth the old price! And probably now, definitely worth the reduced price. Beautiful phone, Amazing interface; fun stops there. You are restricted to ATT and ATT is hit and miss; clear and crackly, in and out regardlesss of bars. Edge is slow. Synching is problamatic (windows/Outlook), the "real internet" lacks Flash and other real internet technologies, No games unless you have internet access, No IM, No MMS, No local storage, smartphone portion of device lacks smartphone features and conveniences, phone needs to be reset frequently, locks up quite a bit when trying to answer calls with BT headset, build quality looks great but case is separating from bezel, slippery to hold and extremely expensive to repair, no removeable battery, too many clicks (button presses) to access standard features like phone. You asked for an Honest opinion. My recommendation is to wait for the 2 iPhone rumored to be out this fall, or for the 2nd Generation iPhone. It is a cool phone, but bragging rights are gone, and fixes are slow to come. They've got an 8 cylinder hitting on 6. If you just need a phone, don't want smartphone features, and you have a lot of money, then go ahead and get it. If you need smartphone features then I'd say get something else and don't look back. My recommendation would be to get a much cheaper phone and buy the new iPod Touch. I think you'd get a lot more utility with that combo.
    I know this won't be a popular post, but he did ask for an honest opinion, and this is mine. Flame me if you wish, but we all have our own perspectives, mine is just one of them. And yes, I did my homework, I do like the phone, but can find no way to justify the cost of it, the speed of patching, and the customer service.

  • Can someone explain to me Vector Class !!

    Can someone explain to me, or tell me where I can find a good tutorial about Vector class.....in simple terms....any good simple, easy to understand tutorials???
    Thank you.
    Rod

    Start with this:
    http://java.sun.com/j2se/1.4/docs/api/java/util/Vector.html
    Essentially, a vector is a single Java object that allows you to store a group of similar things. Each item, or element, inside the Vector must be of the same type, or Java class. The important thing to remember about Vectors is that their size is not fixed. If you don't know how many items you need to store in advance, a Vector is a useful datastore, because you can simply add items into it without worrying about reaching the maximum size. The Vector object will grow itself as you add elements.
    The important methods are described in the above API. Read through it carefully.

  • I really need someone to help me. I have been trying to figure out how to select a PDF document to convert to a Word doc. When I go to select a PDF file, all that shows up is the WORD docs. does not show ANY of my PDF files... Please help me figure out wh

    I really need someone to help me. I have been trying to figure out how to select a PDF document to convert to a Word doc. When I go to select a PDF file, all that shows up is the WORD docs. does not show ANY of my PDF files... Please help me figure out what is going on? We have it set on auto renewal so I know its not that we haven't renewed this subscription, because we pay automatically.

    Hi olivias,
    It sounds like there may be some confusion on your system about what application should be associated with PDF files. You can reset filename associations by following the steps in these articles (depending on your operating system):
    How to change the default application for a file type | Macworld
    http://windows.microsoft.com/en-us/windows/change-default-programs#1TC=windows-7
    Please let us know if you have additional questions.
    Best,
    Sara

  • To ragnic and other about Singleton class

    Hi ragnic. Thanks for your reply. I posted the code wrong. Heres' my correct one.
    I have a GUI first loaded information and the information is stored in a databse, I have some EJB classes..and my singleton class ABC has some method to access to the EJB..
    so my first GUI will gather info using singleton class and later if I click on
    a button in my first GUI class, will pop up another frame of another class , this class also need to class setPassword in my Singleton..
    are my followign codes correctly??
    iS my Class ABC a SINgleton class? thanks
    Is my class ABC use as single correctly. And It is called from other classes is also correct?
    I'm new to java and like to learn about Singleton class.
    But I really dont' understand it clearly after reading many examples of it.
    I have a project to convert my class abc to a singleton.
    But I dont know how to do it.
    In my class(soon will become a singleton) will have few methods that later I need to use it from another class A and class B.
    I have a GUI application that first load my class A..and my class will call
    class abc(singleton) to get some information from it.
    and then in class A has a button, if I click on that button I will call SIngleton class again to update my password, in the singleton class has method calls updatePassword. But I dont know how to call a singleton from other class.
    I have my code for them below:
    1)public class ABC //attempt using a singleton
    private static ABC theABC = null;
    private ABC(){}
    public synchronized static ABC getABC()
    if(theABC == null)
    theABC= new ABC();
    return the ABC;
    public void updateUserInfo(SimpleUser user)
    throws UserNotFoundException, DelegateException
    try
    UserCollectionHome userCollectionHome = (UserCollectionHome)
    EJBHomeFactory.getFactory().lookupHome("vista/UserCollection",
    UserCollectionHome.class);
    UserHome userHome = (UserHome)
    EJBHomeFactory.getFactory().lookupHome("vista/User",UserHome.class);
    UserCollection uc = userCollectionHome.create();
    uc.updateUserInfo(user, userHome);
    } catch(HomeFactoryException hfe) {
    hfe.printStackTrace();
    throw new DelegateException(hfe);
    } catch(RemoteException re) {
    re.printStackTrace();
    throw new DelegateException(re);
    } catch(CreateException ce) {
    ce.printStackTrace();
    throw new DelegateException(ce);
    } catch(FinderException fe) {
    fe.printStackTrace();
    throw new UserNotFoundException();
    public SimpleUser getID(String id)
    throws UserNotFoundException, DelegateException
    try
    UserCollectionHome userCollectionHome = (UserCollectionHome)
    EJBHomeFactory.getFactory().lookupHome("vista/UserCollection",
    UserCollectionHome.class);
    UserHome userHome = (UserHome)
    EJBHomeFactory.getFactory().lookupHome("vista/User",UserHome.class);
    UserCollection uc = userCollectionHome.create();
    SimpleUser su = uc.getID(id, userHome);
    return su;
    } catch(HomeFactoryException hfe) {
    throw new DelegateException(hfe);
    } catch(RemoteException re) {
    throw new DelegateException(re);
    } catch(CreateException ce) {
    throw new DelegateException(ce);
    } catch(FinderException fe) {
    throw new UserNotFoundException();
    public void setPassword(String lname,String pw)
    throws UserNotFoundException, DelegateException
    try
    UserCollectionHome userCollectionHome = (UserCollectionHome)
    EJBHomeFactory.getFactory().lookupHome("vista/UserCollection",
    UserCollectionHome.class);
    UserHome userHome = (UserHome)
    EJBHomeFactory.getFactory().lookupHome("vista/User",UserHome.class);
    UserCollection uc = userCollectionHome.create();
    uc.setPassword(lname,pw, userHome);//assume that all lname are differents.
    } catch(HomeFactoryException hfe) {
    hfe.printStackTrace();
    throw new DelegateException(hfe);
    } catch(RemoteException re) {
    re.printStackTrace();
    throw new DelegateException(re);
    } catch(CreateException ce) {
    ce.printStackTrace();
    throw new DelegateException(ce);
    } catch(FinderException fe) {
    fe.printStackTrace();
    throw new UserNotFoundException();
    }//Do I have my class as a Singleton correctly???
    2)//Here is my First Frame that will call a Singleton to gather user information
    public A(Frame owner)
    super(owner, "User Personal Information",true);
    initScreen();
    loadPersonalInfo();
    * This method instantiates all the GUI widgets and places them into panels and
    * onto the frame.
    private void initScreen()
    txtFname = new JTextField(20);
    txtLname=new JTextField(20);
    btnsave =new JButton("Save");
    btnChange= new JButton("Click here to change PW");//when you click this button there will be a frame pop up for you to enter informaton..this iwll call class B
    JPanel pnlMain=new JPanel();
    JPanel pnlFname= new JPanel();
    pnlFname.setLayout(new BoxLayout(pnlFname, BoxLayout.X_AXIS));
    pnlFname.setBorder(BorderFactory.createEmptyBorder(0,87,0,90));
    pnlFname.add(new JLabel("First Name:"));
    pnlFname.add(Box.createRigidArea(new Dimension(5,0)));
    pnlFname.add(txtFname);
    JPanel pnlLname= new JPanel();
    pnlLname.setLayout(new BoxLayout(pnlLname, BoxLayout.X_AXIS));
    pnlLname.setBorder(BorderFactory.createEmptyBorder(0,87,0,90));
    pnlLname.add(new JLabel("Last Name:"));
    pnlLname.add(Box.createRigidArea(new Dimension(5,0)));
    pnlLname.add(txtLname);
    pnlMain.add(pnlFname);
    pnlMain.add(pnlLname);
    pnlMain.add(btnsave);
    pnlMain.add(btnChange");
    btnSave = new JButton("Save");
    btnSave.setActionCommand("SAVE");
    btnSave.addActionListener(this);
    btnCancel = new JButton("Cancel");
    btnCancel.setActionCommand("CANCEL");
    btnCancel.addActionListener(this);
    JPanel pnlBottom = new JPanel();
    pnlBottom.setLayout(new BoxLayout(pnlBottom, BoxLayout.X_AXIS));
    pnlBottom.setBorder(BorderFactory.createEmptyBorder(25,55,0,0));
    pnlBottom.add(btnSave);
    pnlBottom.add(Box.createRigidArea(new Dimension(25,0)));
    pnlBottom.add(btnCancel);
    pnlMain.add(pnlBottom);
    this.setContentPane( pnlMain);
    setSize(500,500);
    GraphicUtilities.center(this);
    theABC=ABC.getABC();
    //Do I call my ABC singleton class correctly??
    private void loadPersonalInfo()
    String ID= System.getProperty("user.name");
    SimpleUser user = null;
    try {
    user = ABC.getID(ID);
    //I tried to use method in ABC singleton class. IS this correctly call?
    } catch(UserNotFoundException nfe)
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered.",
    "User Not Found",JOptionPane.WARNING_MESSAGE);
    System.exit(0);
    } catch(DelegateException de) {
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered",JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    currentUser = user;
    txtFname.setText(currentUser.getFirstName());
    txtLname.setText(currentUser.getLastName());
    //This information will be display in my textfields Fname and Lname
    //I can change my first and last name and hit button SAVE to save
    public void actionPerformed(ActionEvent e)
    if(e.getActionCommand().equals("SAVE")) submitChanges();
    if(e.getActionCommand().equals("CHANGE_PASSWORD")) {
    changepassword=new ChangePassword(new Frame(),name,badgeid);
    public void submitChanges(){
    String currentNTUsername = System.getProperty("user.name");
    SimpleUser user =null;
    try {
    user = theABC.getID(ID);
    user.setFirstName(txtFname.getText().trim());
    user.setLastName(txtLname.getText().trim());
    currentUser = user;
    theABC.updateUserInfo(currentUser);
    //IS this correctly if I want to use this method in singleton class ABC??
    } catch(UserNotFoundException nfe)
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered",
    "User Not Found",JOptionPane.WARNING_MESSAGE);
    } catch(DelegateException de) {
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered",JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    this.setVisible(false);
    3) click on ChangePassword in my above GUI class A..will call this class B..and in this class B
    I need to access method in a Singleton class- ABC class,,DO i need to inititates it agian, if not what should I do? thanks
    package com.lockheed.vista.userinfo;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import javax.swing.tree.*;
    import java.util.StringTokenizer;
    import java.util.Vector;
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.colorchooser.*;
    import javax.swing.filechooser.*;
    import javax.accessibility.*;
    import java.beans.*;
    import java.applet.*;
    import java.net.*;
    import org.apache.log4j.*;
    import com.lockheed.common.gui.GraphicUtilities;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import vista.user.UserServicesDelegate;
    import vista.user.SimpleUser;
    import vista.user.UserNotFoundException;
    import vista.user.*;
    import com.lockheed.common.ejb.*;
    import com.lockheed.common.gui.*;
    import com.lockheed.vista.publish.*;
    * This program allow users to change their Vista Web Center's password
    public class ChangePassword extends JDialog
    implements ActionListener{
    protected final Logger log = Logger.getLogger(getClass().getName());
    private UserServicesDelegate userServicesDelegate;
    private User currentUser = null;
    private JPasswordField txtPasswd, txtVerifyPW;
    private JButton btnSubmit,btnCancel;
    private JLabel lblName,lblBadgeID;
    private String strBadgeID="";
    * This is the constructor. It creates an instance of the ChangePassword
    * and calls the method to create and build the GUI.
    public ChangePassword(Frame owner,String name,String badgeid)
    super(owner, "Change Password",true);
    initScreen(name,badgeid);//build the GUI
    * This method instantiates all the GUI widgets and places them into panels and
    * onto the frame.
    private void initScreen(String strname,String strBadgeid)
    txtPasswd = new JPasswordField(20);
    txtVerifyPW=new JPasswordField(20);
    txtPasswd.setEchoChar('*');
    txtVerifyPW.setEchoChar('*');
    JPanel pnlMain=new JPanel();
    pnlMain.setLayout(new BoxLayout(pnlMain, BoxLayout.Y_AXIS));
    pnlMain.setBorder(BorderFactory.createEmptyBorder(20,0,20,0));
    JPanel pnlPW=new JPanel();
    pnlPW.setLayout(new BoxLayout(pnlPW, BoxLayout.X_AXIS));
    pnlPW.setBorder(BorderFactory.createEmptyBorder(0,96,0,30));
    pnlPW.add(new JLabel("Password:"));
    pnlPW.add(Box.createRigidArea(new Dimension(5,0)));
    pnlPW.add(txtPasswd);
    JPanel pnlVerifyPW=new JPanel();
    pnlVerifyPW.setLayout(new BoxLayout(pnlVerifyPW, BoxLayout.X_AXIS));
    pnlVerifyPW.setBorder(BorderFactory.createEmptyBorder(0,63,0,30));
    pnlVerifyPW.add(new JLabel("Verify Password:"));
    pnlVerifyPW.add(Box.createRigidArea(new Dimension(5,0)));
    pnlVerifyPW.add(txtVerifyPW);
    JPanel pnlTop= new JPanel();
    pnlTop.add(pnlPW);
    pnlTop.add(Box.createRigidArea(new Dimension(0,10)));
    pnlTop.add(pnlVerifyPW);
    pnlMain.add(pnlTop);
    btnSubmit = new JButton("Submit");
    btnSubmit.setActionCommand("SUBMIT");
    btnSubmit.addActionListener(this);
    btnCancel = new JButton("Cancel");
    btnCancel.setActionCommand("CANCEL");
    btnCancel.addActionListener(this);
    JPanel pnlBottom = new JPanel();
    pnlBottom.setLayout(new BoxLayout(pnlBottom, BoxLayout.X_AXIS));
    pnlBottom.setBorder(BorderFactory.createEmptyBorder(25,55,20,30));
    pnlBottom.add(btnSubmit);
    pnlBottom.add(Box.createRigidArea(new Dimension(25,0)));
    pnlBottom.add(btnCancel);
    pnlMain.add(pnlBottom);
    this.setContentPane( pnlMain);
    setSize(350,230);
    setVisible(true);
    public void actionPerformed(ActionEvent e)
    if(e.getActionCommand().equals("CANCEL")) this.setVisible(false);
    if(e.getActionCommand().equals("SUBMIT")) submitPW();
    * This method is called when the submit button is clicked. It allows user to change
    * their password.
    public void submitPW(){
    myABC= ABC.getABC();//Is this correct?
    char[] pw =txtPasswd.getPassword();
    String strPasswd="";
    for(int i=0;i<pw.length;i++){
    strPasswd=strPasswd+pw;
    char[] vpw =txtVerifyPW.getPassword();
    String strVerifyPW="";
    for(int i=0;i<vpw.length;i++){
    strVerifyPW=strVerifyPW+pw;
    if((strPasswd==null)||(strPasswd.length()==0)) {
    JOptionPane.showMessageDialog(new JDialog(),"You have not enter a password. Please try again.",
    "Invalid Password",JOptionPane.ERROR_MESSAGE);
    if((!strPasswd.equals(strVerifyPW)))
    //password and verify password do not match.
    JOptionPane.showMessageDialog(new JDialog(),"Your passwords do not match. Reenter and try again.",
    "Invalid Password",JOptionPane.ERROR_MESSAGE);
    try
    myABC.setUserPassword(strPasswd);//try to use a method in Singleton class
    txtPasswd.setText("");
    txtVerifyPW.setText("");
    this.setVisible(false);
    } catch(DelegateException e) {
    JOptionPane.showMessageDialog(new Frame(),
    "Error.",
    "Unable to change password information.",JOptionPane.WARNING_MESSAGE);
    } catch(UserNotFoundException e) {
    JOptionPane.showMessageDialog(new Frame(),
    "Error.",
    "Unable to change password information.",JOptionPane.WARNING_MESSAGE);
    And ofcourse I have other EJB classes to work with these classes.
    ***It compiles okey but when I ran, it say "NullPointerException"
    I think I call my Singleton wrong.
    Please help me.thanks

    1. When replying, use <reply>, don't post a new topic.
    2. Implementing a singleton is a frequently asked question. Search before you post.
    3. This is not a question about Swing. A more appropriate forum would be "New To Java Technology" or perhaps "Java Programming", but see point 1.
    4. When posting code, keep it short. It increases the chance of readers looking at it. And in composing your shorter version for the forum, you just may solve your problem.

  • How can I edit a PDF?  Someone told me about the "typewriter" feature, but can't locate that.

    How can I edit a PDF?  Someone told me about the "typewriter" feature, but can't locate that.

    Hi karenw22462415,
    You'll need to Acrobat to edit a PDF file. If you don't have Acrobat, you're welcome to download a 30-day trial from http://www.adobe.com/products/acrobat.html.
    This Help document will get you started: https://helpx.adobe.com/acrobat/using/edit-text-pdfs.html.
    Best,
    Sara

Maybe you are looking for