Need help with getting variable from static

Hello,
What I am building is an application that prompts for username/password before it shows the main screen. Once they have successfully logged in, I need to assign the username that they used, in order to use it for a button event if the make any updates.
Here is the code that I have tried to use.
public String username;
///This set's the public variable username
public void setUserName(String UserName){
username = UserName;
/////////////////Here is where they login, and assign the name to setUsername
public static void main(String args[]) throws SQLException {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
JFrame frame = new JFrame();
JTextField userName = new JTextField();
JTextField passWord = new JTextField();
Object[] options = {"OK","CANCEL"};
Object[] msg = {"UserName:", userName, "Password:", passWord};
final JOptionPane op = new JOptionPane(msg, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){};
JDialog dialog = op.createDialog(frame, "Please Login");
dialog.show();
int result = JOptionPane.OK_OPTION;
try {
result = ((Integer)op.getValue()).intValue();
}catch(Exception uninitializedValue){}
if(result == JOptionPane.OK_OPTION) {
String userID = userName.getText();
String passID = passWord.getText();
Main myMain = new Main();
myMain.setUserName(userID);
if(!userID.equals("") && !passID.equals("")) {
new Main().setVisible(true);
}else {
// user cancelled
////here is the button event that also will need the username
private void selButtonActionPerformed(java.awt.event.ActionEvent evt) {
Connection conn = null;
Statement stmt3 = null;
Statement stmt4 = null;
ResultSet rset3 = null;
ResultSet rset4 = null;
String usernum = null;
String xemu = null;
String loc = null;
String ustat = null;
String manager = null;
String dept = null;
String Add = "Add";
String Update = "Update";
String groupID = "9999";
Vector columnNames = new Vector();
Vector data = new Vector();
String Manager_info[] = {"managerindex", "managers", "managername"};
String Account_info[] = {"acctypeindex", "acctype", "acctypedesc"};
String Group_info[] = {"groupnum", "groups", "groupcode"};
String System_info[] = {"systemindex", "systems", "systemname"};
String Dept_info[] = {"departindex", "departments", "departname"};
String Xemu_info[] = {"xemuindex", "xemulator", "xemudesc"};
String Location_info[] = {"locindex", "location", "locdesc"};
String Ustatus_info[] = {"ustatusindex", "userstatus", "ustatusdesc"};
Date myDate = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy");
String today = formatter.format(myDate);
System.out.println(username);
I am trying to set the public username variable to what the person enters, however since I am creating a seperate instance of it, I don't believe it will work. Any help would be very much appreciated.
Thanks.
Josh

I am developing in Netbeans. If I try to remove the static keyword from main(), netbeans canno't find a main to run. I have created the User class.
Here is the main again to show what I have done.
public static void main(String args[]) throws SQLException {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
User user = new User();
JFrame frame = new JFrame();
JTextField userName = new JTextField();
JTextField passWord = new JTextField();
Object[] options = {"OK","CANCEL"};
Object[] msg = {"UserName:", userName, "Password:", passWord};
final JOptionPane op = new JOptionPane(msg, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){};
JDialog dialog = op.createDialog(frame, "Please Login");
dialog.show();
int result = JOptionPane.OK_OPTION;
try {
result = ((Integer)op.getValue()).intValue();
}catch(Exception uninitializedValue){}
if(result == JOptionPane.OK_OPTION) {
String userID = userName.getText();
String passID = passWord.getText();
user.setName(userID);
user.setPassword(passID);
if(!userID.equals("") && !passID.equals("")) {
//Auth.setUserName(userID);
//Auth.setPassword(passID);
new Main().setVisible(true);
}else {
// user cancelled
This set's the variables
Here is the beginning of the evt that I am using to try and get the data.
private void selButtonActionPerformed(java.awt.event.ActionEvent evt) {                                         
Connection conn = null;
Statement stmt3 = null;
Statement stmt4 = null;
ResultSet rset3 = null;
ResultSet rset4 = null;
String usernum = null;
String xemu = null;
String loc = null;
String ustat = null;
String manager = null;
String dept = null;
String Add = "Add";
String Update = "Update";
String groupID = "9999";
Vector columnNames = new Vector();
Vector data = new Vector();
User user = new User();
String User = user.getName();
System.out.println(User);
String Manager_info[] = {"managerindex", "managers", "managername"};
String Account_info[] = {"acctypeindex", "acctype", "acctypedesc"};
String Group_info[] = {"groupnum", "groups", "groupcode"};
String System_info[] = {"systemindex", "systems", "systemname"};
String Dept_info[] = {"departindex", "departments", "departname"};
String Xemu_info[] = {"xemuindex", "xemulator", "xemudesc"};
String Location_info[] = {"locindex", "location", "locdesc"};
String Ustatus_info[] = {"ustatusindex", "userstatus", "ustatusdesc"};
Date myDate = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy");
String today = formatter.format(myDate);
String [] str = {
"EmpID", "Account", "System", "Type", "Status", "UserID", "Group"
This gives me a null on the println, how can I get the data that was entered in main()?
Thanks,
Josh

Similar Messages

  • HT4199 I need help with getting my printer to print, PLEASE.

    I need help with getting my printer to print, Please.

    What have you done so far?
    I suggest you connect it via a usb  cable first.  Once you get the printer working, move to wifi.  You will have to use an existing printer usb cable or purchase a cable.  Be sure to get the correct cable.  Ask for help.
    The warrenty indicates there is phone support.  Give HP a call.
    Warranty
    One-year limited hardware warranty; 24-hour, 7 days a week phone support
    Robert

  • I need help with a download from Adobe

    I need help with Adode photoshop elements that I bought from Adobe. The download take forever. I can't get signed in very easy. It take forever

    Hi Kathy1963-1964,
    Welcome to Adobe Forum,
    You have photoshop elements 12, you can try downloading without the akamei downloader .
    http://prodesigntools.com/photoshop-elements-12-direct-download-links-premiere.html
    Please read the " very important instruction" prior to downoload.
    I would request you to disable the firewall & the antivirus prior to download.
    Let us know if it worked.
    Regards,
    Rajshree

  • Need help with accesing variable with xpath.

    Hi All,
    I need help with xpath in "Switch" BPEL construct. Switch is used to compare value assigned to output vairable and follow one path for "Deny" and another for "Approve". The following is data type for output variable.
    <element name="processResponse">
         <complexType>
              <sequence>
                   <element name="result" type="string"/>
              <sequence>
         <complexType>
    </element>
    The following expressions in Switch statement throw lava.lang.Exception. It error is xpath internal error".
    x20:compare('Deny',$outputvariable.payload/client:result)
    x20:compare('Deny',bpws:getVariableData('outputvariable','payload','/client:processResponse/client:result')
    It works with x20:compare('Deny','Deny'). So I assumed it must be accessing the variable.
    Any help greatly appreciated.
    Thanks,
    Satish

    Cany you try the following
    x20:compare('Deny',string($outputvariable.payload/client:result))
    x20:compare('Deny',string(bpws:getVariableData('outputvariable','payload','/client:processResponse/client:result'))
    Regards
    Albin I
    http://www.albinsblog.com/

  • Need help with a variable

    I ahve a report that I want to show Free to Sell stock - stock that is in the warehouse that hasn't been allocated.
    I have created a variable called Freestock which basically uses a Physical Stock quantity minus the allocated stock quantity. 
    It is currently just adding all the figures together, instead of splitting it by item, so this is wrong
    Here's the formula I'm using ;
    =Sum(<Warehouse Physical Quantity>-<Outstanding Allocated Quantity>)
    Any help would be greatly appreciated in getting this sorted
    Thanks in advance

    George,
    I am sure the formula is correct.
    It is currently just adding all the figures together, instead of splitting it by item,
    You need to pull this variable with the item object. it will automatically break the number by the Item.
    Hope this helps.
    Kashif

  • Need help with my HttpConnection From Midlet To Servlet...

    NEED HELP ASAP PLEASE....
    This class is supposed to download a file from the servlet...
    the filename is given by the midlet... and the servlet will return the file in bytes...
    everything is ok in emulator...
    but in nokia n70... error occurs...
    Http Version Mismatch shows up... when the pout.flush(); is called.. but when removed... java.io.IOException: -36 occurs...
    also i have posted the same problem in nokia forums..
    please check also...
    http://discussion.forum.nokia.com/forum/showthread.php?t=105567
    now here are my codes...
    midlet side... without pout.flush();
    public class DownloadFile {
        private GmailMidlet midlet;
        private HttpConnection hc;
        private byte[] fileData;
        private boolean downloaded;
        private int lineNumber;
    //    private String url = "http://121.97.220.162:8084/ProxyServer/DownloadFileServlet";
        private String url = "http://121.97.221.183:8084/ProxyServer/DownloadFileServlet";
    //    private String url = "http://121.97.221.183:8084/ProxyServer/Attachments/mark.ramos222/GmailId111d822a8bd6f6bb/01032007066.jpg";
        /** Creates a new instance of DownloadFile */
        public DownloadFile(GmailMidlet midlet, String fileName) throws OutOfMemoryError, IOException {
            System.gc();
            setHc(null);
            OutputStream out = null;
            DataInputStream is= null;
            try{
                setHc((HttpConnection)Connector.open(getUrl(), Connector.READ_WRITE));
            } catch(ConnectionNotFoundException ex){
                setHc(null);
            } catch(IOException ioex){
                ioex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C1", ioex.toString(),
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
            try {
                if(getHc() != null){
                    getHc().setRequestMethod(HttpConnection.POST);
                    getHc().setRequestProperty("Accept","*/*");
                    getHc().setRequestProperty("Http-version","HTTP/1.1");
                    lineNumber = 1;
                    getHc().setRequestProperty("CONTENT-TYPE",
                            "text/plain");
                    lineNumber = 2;
                    getHc().setRequestProperty("User-Agent",
                            "Profile/MIDP-2.0 Configuration/CLDC-1.1");
                    lineNumber =3;
                    out = getHc().openOutputStream();
                    lineNumber = 4;
                    PrintStream pout = new PrintStream(out);
                    lineNumber = 5;
                    pout.println(fileName);
                    lineNumber = 6;
    //                pout.flush();
                    System.out.println("File Name: "+fileName);
                    lineNumber = 7;
                    is = getHc().openDataInputStream();
                    long len = getHc().getLength();
                    lineNumber = 8;
                    byte temp[] = new byte[(int)len];
                    lineNumber = 9;
                    System.out.println("len "+len);
                    is.readFully(temp,0,(int)len);
                    lineNumber = 10;
                    setFileData(temp);
                    lineNumber = 11;
                    is.close();
                    lineNumber = 12;
                    if(getFileData() != null)
                        setDownloaded(true);
                    else
                        setDownloaded(false);
                    System.out.println("Length : "+temp.length);
                    midlet.setAttachFile(getFileData());
                    lineNumber = 13;
                    pout.close();
                    lineNumber = 14;
                    out.close();
                    lineNumber = 15;
                    getHc().close();
            } catch(Exception ex){
                setDownloaded(false);
                ex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C2+ line"+lineNumber,
                        ex.toString()+
                        " | ",
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
        public HttpConnection getHc() {
            return hc;
        public void setHc(HttpConnection hc) {
            this.hc = hc;
        public String getUrl() {
            return url;
        public void setUrl(String url) {
            this.url = url;
        public byte[] getFileData() {
            return fileData;
        public void setFileData(byte[] fileData) {
            this.fileData = fileData;
        public boolean isDownloaded() {
            return downloaded;
        public void setDownloaded(boolean downloaded) {
            this.downloaded = downloaded;
    }this is the midlet side with pout.flush();
    showing Http Version Mismatch
    public class DownloadFile {
        private GmailMidlet midlet;
        private HttpConnection hc;
        private byte[] fileData;
        private boolean downloaded;
        private int lineNumber;
    //    private String url = "http://121.97.220.162:8084/ProxyServer/DownloadFileServlet";
        private String url = "http://121.97.221.183:8084/ProxyServer/DownloadFileServlet";
    //    private String url = "http://121.97.221.183:8084/ProxyServer/Attachments/mark.ramos222/GmailId111d822a8bd6f6bb/01032007066.jpg";
        /** Creates a new instance of DownloadFile */
        public DownloadFile(GmailMidlet midlet, String fileName) throws OutOfMemoryError, IOException {
            System.gc();
            setHc(null);
            OutputStream out = null;
            DataInputStream is= null;
            try{
                setHc((HttpConnection)Connector.open(getUrl(), Connector.READ_WRITE));
            } catch(ConnectionNotFoundException ex){
                setHc(null);
            } catch(IOException ioex){
                ioex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C1", ioex.toString(),
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
            try {
                if(getHc() != null){
                    getHc().setRequestMethod(HttpConnection.POST);
                    getHc().setRequestProperty("Accept","*/*");
                    getHc().setRequestProperty("Http-version","HTTP/1.1");
                    lineNumber = 1;
                    getHc().setRequestProperty("CONTENT-TYPE",
                            "text/plain");
                    lineNumber = 2;
                    getHc().setRequestProperty("User-Agent",
                            "Profile/MIDP-2.0 Configuration/CLDC-1.1");
                    lineNumber =3;
                    out = getHc().openOutputStream();
                    lineNumber = 4;
                    PrintStream pout = new PrintStream(out);
                    lineNumber = 5;
                    pout.println(fileName);
                    lineNumber = 6;
                    pout.flush();
                    System.out.println("File Name: "+fileName);
                    lineNumber = 7;
                    is = getHc().openDataInputStream();
                    long len = getHc().getLength();
                    lineNumber = 8;
                    byte temp[] = new byte[(int)len];
                    lineNumber = 9;
                    System.out.println("len "+len);
                    is.readFully(temp,0,(int)len);
                    lineNumber = 10;
                    setFileData(temp);
                    lineNumber = 11;
                    is.close();
                    lineNumber = 12;
                    if(getFileData() != null)
                        setDownloaded(true);
                    else
                        setDownloaded(false);
                    System.out.println("Length : "+temp.length);
                    midlet.setAttachFile(getFileData());
                    lineNumber = 13;
                    pout.close();
                    lineNumber = 14;
                    out.close();
                    lineNumber = 15;
                    getHc().close();
            } catch(Exception ex){
                setDownloaded(false);
                ex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C2+ line"+lineNumber,
                        ex.toString()+
                        " | ",
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
        public HttpConnection getHc() {
            return hc;
        public void setHc(HttpConnection hc) {
            this.hc = hc;
        public String getUrl() {
            return url;
        public void setUrl(String url) {
            this.url = url;
        public byte[] getFileData() {
            return fileData;
        public void setFileData(byte[] fileData) {
            this.fileData = fileData;
        public boolean isDownloaded() {
            return downloaded;
        public void setDownloaded(boolean downloaded) {
            this.downloaded = downloaded;
    }here is the servlet side...
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            if(request.getMethod().equals("POST")){
                BufferedReader dataIN = request.getReader();
                String fileName = dataIN.readLine();
                File file = new File(fileName);
                String contentType = getServletContext().getMimeType(fileName);
                response.setContentType(contentType);
                System.out.println("Content Type: "+contentType);
                System.out.println("File Name: "+fileName);
                int size = (int)file.length()/1024;
                if(file.length() > Integer.MAX_VALUE){
                    System.out.println("Very Large File!!!");
                response.setContentLength(size*1024);
                FileInputStream fis = new FileInputStream(fileName);
                byte data[] = new byte[size*1024];
                fis.read(data);
                System.out.println("data lenght: "+data.length);
                ServletOutputStream sos = response.getOutputStream();
                sos.write(data);
    //            out.flush();
            }else{
                response.setContentType("text/plain");
                PrintWriter out = response.getWriter();
                BufferedReader dataIN = request.getReader();
                String msg_uid = dataIN.readLine();
                System.out.println("Msg_uid"+msg_uid);
                JDBConnection dbconn = new JDBConnection();
                String fileName = dbconn.getAttachment(msg_uid);
                String[] fileNames = fileName.split(";");
                int numFiles = fileNames.length;
                out.println(numFiles);
                for(int i = 0; i<numFiles; i++){
                    out.println(fileNames);
    out.flush();
    out.close();
    Message was edited by:
    Mark.Ramos222

    1) Have you looked up the symbian error -36 on new-lc?
    2) Have you tried the example in the response on forum nokia?
    3) Is the address "121.97.220.162:8084" accessible from the internet, on the device, on the specified port?

  • Hi i need help with getting my homework for school

    im in a nine week class that ends tommorw and need help go\etting my program working properly these are the requirements ofr the assignments:
    Modify the Inventory Program by adding a button to the GUI that allows the user to move
    to the first item, the previous item, the next item, and the last item in the inventory. If the
    first item is displayed and the user clicks on the Previous button, the last item should
    display. If the last item is displayed and the user clicks on the Next button, the first item
    should display.
    · Add a company logo to the GUI using Java graphics classes.
    Modify the Inventory Program to include an Add button, a Delete button, and a Modifybutton on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock, and the price of each unit. An item added to the inventory should have an item number one more than the previous last item. Add a Save button to the GUI that saves the inventory to a C:\data\inventory.dat file. Use exception handling to create the directory and file if necessary. Add a search button to the GUI that allows the user to search for an item in the inventory by the product name. If the product is not found, the GUI should display an appropriate message. If the product is found, the GUI should display that product’s information in the GUI. Post final .class and .java files as an attachment.
    this is what i have there are three java files im puttong in here
    first is the panel frame
    import java.awt.GridLayout;
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.Component;
    import javax.swing.SwingConstants;
    import javax.swing.Icon;
    import javax.swing.JComboBox;
    import javax.swing.JTextArea;
    import javax.swing.JList;
    import java.util.*;
    import java.text.NumberFormat;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    import java.io.*;
    import java.util.Scanner;
    import javax.swing.JOptionPane;
    import java.text.NumberFormat;
    public class PanelFrame extends JFrame
         private JPanel buttonJPanel; // panel to hold buttons
         private JButton buttons[]; // array of buttons
         private JLabel label1; // JLabel iventory number
         private JLabel label2; // JLabel product name
         private JLabel label3; // JLabel product price
         private JLabel label4; // JLabel product in stock
         private String p_ProductName; // private variable for the employee name.
         private int p_UnitCount; // private variable for the hours worked.
         private double p_UnitPrice; // private variable for the hourly wage.
         private int p_ItemNumber; // private inventory number
         //create inventory object
         Inventory myInventory = new Inventory ();
    // no-argument constructor
    public PanelFrame()
    super( "Panel Demo" );
    //Add items to the inventory within the Invntory
              myInventory.addItem(new productinfo(1,"Html a Begginers Guide",14,29.99));
              myInventory.addItem(new productinfo(2,"Html 4 for Dummies",6,29.99));
              myInventory.addItem(new productinfo(3,"Visio Step by Step",7,24.99));
              myInventory.addItem(new productinfo(4,"APA Publication Manual",14,47.99));
              myInventory.addItem(new productinfo(5,"The Gregg Reference Manual",14,37.56));
    setLayout( new FlowLayout() ); // set frame layout
    // JLabel constructor with a string argument
              label1 = new JLabel( "Inventory Number:%s: %d\n ",p_ItemNumber );
              label1.setToolTipText( "This is Inventory number" );
              add( label1 ); // add label1 to JFrame
              label2 = new JLabel( "\n\nProduct Name: %s: %s\n", p_ProductName);
              label2.setToolTipText( "This is Product Name" );
              add( label2 ); // add label1 to JFrame
              label3 = new JLabel( "\n\nPrice : %s:$%.2f\n",p_UnitPrice );
              label3.setToolTipText( "This is product Price");
              add( label3 ); // add label1 to JFrame
              label4 = new JLabel( "\n\nQuanity %s: %d\n",p_UnitCount);
              label4.setToolTipText( "This is Quanity in stock: " );
              add( label4 ); // add label1 to JFrame
    buttons = new JButton[ 4 ]; // create buttons array
    buttonJPanel = new JPanel(); // set up panel
    buttonJPanel.setLayout( new GridLayout( 1, buttons.length ) );
              String names[] = { "First", "Previous", "Next", "Last"  };
              JButton buttons[] = new JButton[ names.length ];
              // create and add buttons
              for ( int count = 0; count < buttons.length; count++ )
              buttons[ count ] = new JButton( names[ count ] );
              buttonJPanel.add( buttons[ count ] ); // add button to panel
              } // end for
    // setup the logo for the GUI ...image needs to be in same directory as source code
              URL url = this.getClass().getResource("book103.gif");
              Image img = Toolkit.getDefaultToolkit().getImage(url);
              // scale the image so that it'll fit in the GUI
              Image scaledImage = img.getScaledInstance(100, 100, Image.SCALE_AREA_AVERAGING);
              // create a JLabel with the image as the label's Icon
              Icon logoIcon = new ImageIcon(scaledImage);
              JLabel companyLogoLabel = new JLabel(logoIcon);
              companyLogoLabel.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
              // add the logo to the GUI
              getContentPane().add(companyLogoLabel, BorderLayout.WEST);
    add( buttonJPanel, BorderLayout.SOUTH ); // add panel to JFrame
    } // end PanelFrame constructor
    } // end class PanelFrame

    this is the original part again with the code tag added
    import java.awt.GridLayout;
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.Component;
    import javax.swing.SwingConstants;
    import javax.swing.Icon;
    import javax.swing.JComboBox;
    import javax.swing.JTextArea;
    import javax.swing.JList;
    import java.util.;
    import java.text.NumberFormat;
    import javax.swing.;
    import java.awt.;
    import java.awt.event.;
    import java.net.URL;
    import java.io.*;
    import java.util.Scanner;
    import javax.swing.JOptionPane;
    import java.text.NumberFormat;
    public class PanelFrame extends JFrame
    private JPanel buttonJPanel; // panel to hold buttons
    private JButton buttons[]; // array of buttons
    private JLabel label1; // JLabel iventory number
    private JLabel label2; // JLabel product name
    private JLabel label3; // JLabel product price
    private JLabel label4; // JLabel product in stock
    private String p_ProductName; // private variable for the employee name.
    private int p_UnitCount; // private variable for the hours worked.
    private double p_UnitPrice; // private variable for the hourly wage.
    private int p_ItemNumber; // private inventory number
    //create inventory object
    Inventory myInventory = new Inventory ();
    // no-argument constructor
    public PanelFrame()
    super( "Panel Demo" );
    //Add items to the inventory within the Invntory
    myInventory.addItem(new productinfo(1,"Html a Begginers Guide",14,29.99));
    myInventory.addItem(new productinfo(2,"Html 4 for Dummies",6,29.99));
    myInventory.addItem(new productinfo(3,"Visio Step by Step",7,24.99));
    myInventory.addItem(new productinfo(4,"APA Publication Manual",14,47.99));
    myInventory.addItem(new productinfo(5,"The Gregg Reference Manual",14,37.56));
    setLayout( new FlowLayout() ); // set frame layout
    // JLabel constructor with a string argument
    label1 = new JLabel( "Inventory Number:%s: %d\n ",p_ItemNumber );
    label1.setToolTipText( "This is Inventory number" );
    add( label1 ); // add label1 to JFrame
    label2 = new JLabel( "\n\nProduct Name: %s: %s\n", p_ProductName);
    label2.setToolTipText( "This is Product Name" );
    add( label2 ); // add label1 to JFrame
    label3 = new JLabel( "\n\nPrice : %s:$%.2f\n",p_UnitPrice );
    label3.setToolTipText( "This is product Price");
    add( label3 ); // add label1 to JFrame
    label4 = new JLabel( "\n\nQuanity %s: %d\n",p_UnitCount);
    label4.setToolTipText( "This is Quanity in stock: " );
    add( label4 ); // add label1 to JFrame
    buttons = new JButton[ 4 ]; // create buttons array
    buttonJPanel = new JPanel(); // set up panel
    buttonJPanel.setLayout( new GridLayout( 1, buttons.length ) );
    String names[] = { "First", "Previous", "Next", "Last" };
    JButton buttons[] = new JButton[ names.length ];
    // create and add buttons
    for ( int count = 0; count < buttons.length; count++ )
    buttons[ count ] = new JButton( names[ count ] );
    buttonJPanel.add( buttons[ count ] ); // add button to panel
    } // end for
    // setup the logo for the GUI ...image needs to be in same directory as source code
    URL url = this.getClass().getResource("book103.gif");
    Image img = Toolkit.getDefaultToolkit().getImage(url);
    // scale the image so that it'll fit in the GUI
    Image scaledImage = img.getScaledInstance(100, 100, Image.SCALE_AREA_AVERAGING);
    // create a JLabel with the image as the label's Icon
    Icon logoIcon = new ImageIcon(scaledImage);
    JLabel companyLogoLabel = new JLabel(logoIcon);
    companyLogoLabel.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
    // add the logo to the GUI
    getContentPane().add(companyLogoLabel, BorderLayout.WEST);
    add( buttonJPanel, BorderLayout.SOUTH ); // add panel to JFrame
    } // end PanelFrame constructor
    } // end class PanelFrame

  • Need Help to get value from MessageChoice and pass it to another MesgChoice

    Hi All,
    How to get a value from a messageChoice1 in CO into a variable. Once the messageChoice1 is selected i need to pass this variable into a VO whereClause and the page get refreshed, so that another messageChoice2 in the same page will have the values based on the messageChoice1 value.
    Kindly give me your suggestions.
    Thanks and Regards,
    Myvizhi

    I think you want to do a nested loop within each Item in the data provider, to pull out each child's (series1, series2, etc). "label" attribute.

  • I need help with a migration from Exchange 2010 to 2007

    Hi All,
    I need help migrating mailboxes from a separate forest / domain using exchange 2010 to our Exchange 2007 SP3 servers..  I am following this procedure:
    1. On source server, create a mailbox user, test01.
    2. On target server, run the following command to move the AD account:
    Prepare-MoveRequest.Ps1 -Identity [email protected] -RemoteForestDomainController FQDN.source.com -RemoteForestCredential $Remote -LocalForestDomainController FQDN.target.com -LocalForestCredential $Local -UseLocalObject -Verbose"
    3. Run the ADMT to migrate the password and SID history.
    4. Run the following command to move the mailbox:
    New-MoveRequest -Identity '[email protected]' -RemoteLegacy -RemoteTargetDatabase DB03 -RemoteGlobalCatalog 'GC01.humongousinsurance.com' -RemoteCredential $Cred -TargetDeliveryDomain 'mail.contoso.com'
    (Changed all the details obviously)
    It gets to 95% and shows this error
    01/12/2014 12:47:24 [EX2K10] Fatal error UpdateMovedMailboxPermanentException has occurred.
    Error details: An error occurred while updating a user object after the move operation. --> Active Directory operation failed on DC.DC.COM . This error is not retriable. Additional information: The parameter is incorrect.
    Active directory response: 00000057: LdapErr: DSID-0C090A85, comment: Error in attribute conversion operation, data 0, vece --> The requested attribute does not exist.
       at Microsoft.Exchange.MailboxReplicationService.LocalMailbox.Microsoft.Exchange.MailboxReplicationService.IMailbox.UpdateMovedMailbox(UpdateMovedMailboxOperation op, ADUser remoteRecipientData, String domainController, ReportEntry[]& entries,
    Guid newDatabaseGuid, Guid newArchiveDatabaseGuid, String archiveDomain, ArchiveStatusFlags archiveStatus)
       at Microsoft.Exchange.MailboxReplicationService.MailboxWrapper.<>c__DisplayClass3c.<Microsoft.Exchange.MailboxReplicationService.IMailbox.UpdateMovedMailbox>b__3b()
       at Microsoft.Exchange.MailboxReplicationService.ExecutionContext.Execute(GenericCallDelegate operation)
       at Microsoft.Exchange.MailboxReplicationService.MailboxWrapper.Microsoft.Exchange.MailboxReplicationService.IMailbox.UpdateMovedMailbox(UpdateMovedMailboxOperation op, ADUser remoteRecipientData, String domainController, ReportEntry[]& entries,
    Guid newDatabaseGuid, Guid newArchiveDatabaseGuid, String archiveDomain, ArchiveStatusFlags archiveStatus)
       at Microsoft.Exchange.MailboxReplicationService.RemoteMoveJob.UpdateMovedMailbox()
       at Microsoft.Exchange.MailboxReplicationService.MoveBaseJob.UpdateAD(Object[] wiParams)
       at Microsoft.Exchange.MailboxReplicationService.CommonUtils.CatchKnownExceptions(GenericCallDelegate del, FailureDelegate failureDelegate)
    Error context: --------
    Operation: IMailbox.UpdateMovedMailbox
    OperationSide: Target
    Primary (b5373e49-6a06-41f4-990e-27807c7a57f3)
    01/12/2014 12:47:24 [EX2K10] Relinquishing job.
    Any ideas what i can do about this? 

    Hi,
    From your description, I recommend you follow the steps below for troubleshooting:
    Open the problematic user in AD and check the Email Address. Verify if you can open or edit the x400 address. If no, remove the x400 address and recreate it. If yes, ensure that the name is spelt correctly. After that, continue to move the mailbox and check
    the result.
    Hope this can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Need help with "get info" dialog box

    Hi Everyone!
    I need some help with trying to figure out what some of the options are in the "Get Info" dialog box. I've searched the iTunes help and these forums, but can't find anything.
    So, in the options tab,
    1. What does "Part of compilation" Y/N, do for me?
    2. Same for "Remember Position"
    3. And finally, "Gapless album"
    Thanks, Vince.

    1. when you import a compilation album (like an 80's compilation or something), itunes will import it as
    song 1, artist 1, 80's greatest hits
    song 2, artist 2, 80's greatest hits etc
    Click part of a compliation means that, it means that it would keep them altogether rather than having lots of songs everywhere
    2. If you start playing a song, then stop, part way through, when you next come to the song, itunes will remember where you left off
    3. Albums like jean michel jarre, classical, mike oldfield, etc, have many songs which merge into each other. Having gapless album ticked will ensure that, when playing the album, there are no gaps between songs

  • New User: Needs Help with getting started with the Z

    Hi, my son got a creative Zen for xmas, only getting round to getting it together now, and having some problems with the manual. All this is new to us -technology etc. We have managed to rip a CD but cant get any further! Downloading from internet sounds like such a good idea, but 'know-how-to do' seems light years away in this house! Is there an easy start manual or step by step directions that I've missed out on somewhere? the quick start manual is fine for learning how to use the player but doesn't give any info on ripping CDs and whatever comes after. Can any of you 'experts' bring yourselves back to the begining and explain what to do in simple english?
    Message Edited by Jeremy-CL on 02-0-2005 0:25 AM

    Mother,
    I moved and edited your message as your are more likely to get help out here. As far as suggestions go for downloading from the internet goes, there is not a lot of difference between getting it from CDs. The main difference is the process of actually getting the music.
    First off there are several music stores out there and some that are free. Here are a few suggestions (this is all personal knowledge, this is not an official endorsement of any of these):
    Napster - Integrates into Windows Media Player if you desire and can transfer directly to most Zens. Also allows a user to subscribe to an account that allows for streaming and computer only downloads of music (must purchase song to transfer to the player...usually around .99 a song)
    Buymusic.com - Website interface that sells individual tracks and albums.
    Wallmart music store - Website interface that sells individual tracks and albums.
    There are others but these three are the mains ones (outside of itunes, which is designed for the Ipod).
    Basically once you download them, you go into MediaSource or Windows Media Player and add the files to the music library. Then you just transfer like you do with CDs.
    JeremyMessage Edited by Jeremy-CL on 02-0-2005 0:34 AM

  • A little help with getting varaibles from another class

    hey,
    so i have these two classes and they both are GUI's. the first main class is called GUI (very original) and he second is called adder. so when i click a button on GUI it creates and shows the adder GUI wich gets user input, when the user clicks the done button on the adder gui it does this this:
          * method to dispose of the gui without deleting the object
         public void close()
             addWindow.dispose();
          * method for when the done button is clicked
         private void buttonClicked()
         personName = ename.getText();
            personPin = epin.getText();
            personAddress = address.getText();
            close();
        }then we go to the GUI class and do this:
    public void addPart2()
            lm.addElement(adder.personName + "-" + adder.personID + "-" + adder.personAddress + "-" + adder.personPin );
        }(all varibless are public by the way), so when i go and have a method directly call adderPart2 right after the adder gui is closed it comes up with all variables bieng null, but if i go in and manualy call the method without doing anything else it works, can anyone explainthis and/or hellp me?

    so does anyone have a solution for this problem or at least know what is happening?
    Thanks a-bundle,
    Mike M

  • I need help with viewing files from the external hard drive on Mac

    I own a 2010 mac pro 13' and using OS X 10.9.2(current version). The issue that I am in need of help is with my external hard drive.
    I am a photographer so It's safe and convinent to store pictures in my external hard drive.
    I have 1TB external hard drive and I've been using for about a year and never dropped it or didn't do any thing to harm the hardware.
    Today as always I connected the ext-hard drive to my mac and click on the icon.
    All of my pictures and files are gone accept one folder that has program.
    So I pulled up the external hard drive's info it says the date is still there, but somehow i can not view them in the finder.
    I really need help how to fix this issue!

    you have a notebook, there is a different forum.
    redundancy for files AND backups, and even cloud services
    so a reboot with shift key and verify? Recovery mode
    but two or more drives.
    a backup, a new data drive, a drive for recovery using Data Rescue III
    A drive can fail and usually not if, only when
    and is it bus powered or not

  • Need help with maintaining variable choices in new session

    I have a flash app. set up with several variables. Is there a
    simple action script that will allow the user to maintain their
    choices after closing the .swf and re-launching it?
    Thanks in advance for your help.

    how are you checking if those components have been checked or
    ticked. actually, i probably don't want to know that.
    you really should be using a listener to detect when your
    components have changed and then you can use the changed method to
    set your variables and update your sharedobject.

  • Need help with getting images to look smooth (without the bitmap squares) around the edges. When I transfer the image from pictures, it sets itself into the InDesign layout, but with square edges. I need to find out how to get it to look smooth?

    Need to find out how to get my images transferred into an InDesign layout without the rough edges, as with a bit map image, but to appear with smooth edges in the layout. I can notice it more when I enlarge the file (pic). How can I get it to appear smooth in the finished layout. Another thing too that I noticed; it seems to have effected the other photos in the layout. They seem to be
    pixelated too after I import the illustration (hand drawn artwork...)? Any assistance with this issue will be greatly appreciated. Thanks in advance.

    No Clipboard, no copy & paste, as you would not get the full information of the image.
    When you paste you can't get the image info from the Links panel, but you can get resolution and color info either via the Preflight panel or by exporting to PDF and checking the image in Acrobat.
    Here I've pasted a 300ppi image, scaled it, and made a Preflight rule that catches any image under 1200ppi. The panel gives me the effective resolution of the pasted image as 556ppi. There are other workflow reasons not to paste—you loose the ability to easily edit the original and large file sizes—but pasting wouldn't cause a loss in effective resolution or change in color mode.

Maybe you are looking for

  • How do I force Mail to use contact names in Address Book?

    I ~need~ Apple Mail to display sender names as I have them in Address Book. My students are Thai and have typed their sender names in Thai, so I can't recognise a thing. I've sorted all the names out in Address Book (in English) but Mail still displa

  • Combine Files into a Single PDF from the Create button

    I'm using Adobe Acrobat 10.1.13 and trying to Combine Files into a Single PDF from the Create button. There are four file types .pdf .doc .xls .dwg the only file that appears in the Combine dialog box is the .pdf

  • How to recover damaged windows that have installed oracle 9i?

    Hi. Now I got oracle 9i server on windows XP for develop purpose. Few days ago windows XP has damaged, now it couldn't be booted. In that oracle 9i server, lots of procedures and packages that were under developing. I'm sure that oracle server doesn'

  • Ipod touch and itunes sync

    ok...I now have a Mac Pro Notebook. I want to get allllllll of my songs into my itunes library. However, it will only sync the songs "purchased" on my ipod. How do I get them all from my ipod touch without having to download to a jump drive from my o

  • Change highlight color in pages

    Hey guys and gals, Would anyone happen to know whether changing highlight color in Pages is possible, and if so - how? I searched all over and found no satifsying answers. Thank in advance! Eran