Quick Question about linked lists

If I have a linked list can i save it to a file directly with the Serializable interface or would I have to iterate through each element and write each element to the file?

yeah, it seems as though I can
However, I am having a problem reading it back. I guess I don't know how to initialize the values in the list, as it doens't recognize anything until I add an item to it and it adds this item to the front, then any other items after that it will add to the back, when i want this first addition to be in the back as well.
when I initialize the class i call
list.add(loadList());
loadList()
public MyList loadList() {
           try {
             FileInputStream fis = new FileInputStream("data.dat");
             ObjectInputStream in = new ObjectInputStream(fis);
             list = (MyList)in.readObject();
             in.close();
             return list;
           catch (Exception e) {
               System.out.println(e);
          return list;
       }list.add()
public void add(int index, Object o)
          if (index == 0) addFirst(o);
          else if (index >= size) addLast(o);
          else {
               Node current = first;
               for (int i = 1; i < index; i++)
                    current.prev = current;
                    current = current.next;
               Node temp = current.next;
               current.next = new Node(o);
               current.prev = current;
               (current.next).next = temp;
               size++;
     }any ideas?

Similar Messages

  • Question about Linked Lists

    I'm doing an assignment on linked lists and I'm having trouble understanding the insert method. I'm using the one from the book and it works fine, but I don't quite understand it.
    public void insert(Object o) {
    Node n = new Node(o,current);
    if (previous == null)
    head = n;
    else
    previous.next = n;
    current = n;
    It's my understanding that current is the value that your currently at in the list. Previous is equal to the value before the current. So, previous.next is equal to current. This reasoning won't make the list progress with this code. Can someone tell me what I'm not understanding, or explain how this progresses?

    Thanks, that helps alot. Now, I have another question. I need to add and remove nodes from the list. I have it setup where the user can choose what node to delete. It compiles and runs fine, but when I try to delete a node, it doesn't delete it. Doing some troubleshooting, I found that it gets into the for loop, but doesn't do anything with the if/else statement. I put a printline in the if and else part, and it never printed out the statement in the if statement or in the else statement. Here's the code I'm using. getLentgh() is a method I wrote to return an integer value of how many nodes are in the list. I've also tried putting in a printline after the for loop, but still in the try, it didn't print it out.
    else if(source == remove) {
    String del = JOptionPane.showInputDialog("Enter an integer to remove.");
    Node temp = new Node(del,current);
    if(del != null){
    try{
         for(int c = 0; c < list.getLength(); c++){            
         if(temp.data == current.data){
              list.remove();
              c = list.getLength();
         else{
              list.advance();     
    }catch(NullPointerException e){
    }

  • Quick question about a list

    I have a function in a component that has
    <function>
    <query queryOne>
    </query>
    <cfset to listOne>
    <query queryTwo>
    </query>
    <cfloop queryTwo>
    <cfif ListFind(listOne, queryTwo.field)>
    do this stuff
    </cfif>
    </cfloop>
    </function>
    I can see both queries pull the correct info when running
    them in my db program... but its not running my do this stuff...
    should I be able to access the list or do I have to so a
    variable.listOne? If it is right, them maybe I have some other
    logic issue, I just wanted to cross out one possible place I messed
    it up.
    Thanks,
    Va.

    Your sample code is a bit cryptic, but your problem is
    probably the ListFind function. If there is case sensitivity, use
    ListFindNoCase( ).

  • A quick question about WebDynpro SLD and R/3 with concurrent users

    Hello ,
    I have a very quick question about Webdynpros and SLD connecting to an R/3 system, when you configure a webdynpro to connect to an R/3 system using SLD, you configure a user name and password from the R/3  for the SLD to use. What I would like to know is when I have concurrent users of my webdynpro, how can I know what one user did in R/3 and what another user did? Is there a way for the users of the web dynpro to use their R/3 credentials so SLD can access the R/3? Like dynamically configuring the SLD for each user?
    - I would like to avoid leaving their their passwords open in the code ( configuring two variable to get the users username and password and use these variables as JCO username and password )
    Thanks Ubergeeks,
    Guy

    Hi Guy
    You will have to use Single Sign On to achieve this. In the destination you have defined to connect to R/3 , there is an option to 'useSSO' instead of userid and password. This will ensure that calls to R/3 will be with the userid that has logged into WAS. You wont need to pass any passwords because  a login ticket is generated from WAS and passed on to R/3. The userid is derived from this ticket.
    For this to happen you will have to maintain a trust relation ship between R/3 and your WAS ,there is detailed documentation of this in help files. Configuration is very straight forward and is easy to perform
    Regards
    Pran

  • QUICK QUESTION ABOUT PORTS

    Hi, I have a quick question about port forwarding/mapping. My question, lets say I am running MSN messenger, who's ports are 6880-6900. But lets say I am running a torrent application or something else that requires those ports. If both applications were running at the same time, would this cause interference with them on the same ports or now. Thanks
    Nathan

    Normally, only one application can listen to a specific port number at a time. If MSN is grabbing those 21 ports then your torrent app won't be able to run.
    However, most apps don't work that way - even if they use multiple ports, they don't use them all at the same time, so MSN might use 6880 when it starts up, leaving the others open for other applications to use if needed.
    Only experimentation will answer that one.

  • Hi, I have quick question about use of USEBEAN tag in SP2. When I specify a scope of SESSION for the java bean, it does not keep the values that I set for variable in the bean persistent.Thanks,Sonny

     

    Make sure that your bean is implementing the serializable interface and that
    you are accessing the bean from the session with the same name.
    Bryan
    "Sandeep Suri" <[email protected]> wrote in message
    news:[email protected]..
    Hi, I have quick question about use of USEBEAN tag in SP2. When I
    specify a scope of SESSION for the java bean, it does not keep the
    values that I set for variable in the bean persistent.Thanks,Sonny
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • IMovie - quick questions about video files when importing and optimizing

    Hi, have some quick questions. I think they are simple.
    1. When I import a video (from say iPhoto), where does it get "Move" or "Copy" to?
    2. Why would I want to do "Copy" instead of "Move", because isn't it then taking up more space?
    3. I'm wondering if after I optimize a video, I can stash away the original (non-optimized video that I either "Move"d or "Copy"d earlier) into an external hd.
    4. By the way, what is the new file name of the optimized video?
    Though things are working fine in iMovie and iPhoto, I'm trying to manage hard disk space, and hope answers to these questions will help.
    Do you guys have a guideline on how to manage hard disk space when it comes to iphoto and imovie?
    Thanks.

    As has been suggested you can encourage people to download QuickTime player by doing something like this...
    http://www.mirroroftheuniverse.com/Songs.html
    You can also present your songs like this...
    http://roddymckay.com/Satellite/JukeBox.html
    This is a SnoCap jukebox and you need an account to use it but you'll get the link to ESnips on the above page.
    A 3 minute song has a file size of about 30 Mb in AIFF format. Converting it to MP3 reduces it to about 3.5 Mb and M4A to about 5.5 Mb.
    iTunes will do these conversions for you and M4A is far superior to MP3 as far as sound quality is concerned.

  • Quick Question about Cisco 3560 and the Web Device Manager

    Alright, I have a quick question that I am curious about but I haven't found any information
    about it.
    When I log into my Cisco 3560 using the web portal to get to the Device Manager. Below the
    diagram of the switch, then under the Dashboard there is section called Switch
    Health, Port Utilization.
    Under the Switch Health there is Bandwidth Used, Packet Error. Those two options just sit
    at zero and do not move. The Port tilization graph is also sitting at zero.
    Is there a way to make them functional?

    Anyone notice performance increase or decrease of their HD when using the nVidia IDE SW drivers?  particularly with a 74GB Raptor?  I've also heard of burner issues when installing the IDE SW but have not used my burner yet.

  • Quick Questions about the New T530

    With the T530 finally showing up online for those of us in the U.S., I have thrown it into the pool of models I am considering and comparing it to the T520, but it is getting very hard to find information about it. Here are my top questions about it that I can not find answer to.
    #1: Can the backlight on the keyboard (if you choose to get one with it) be toggled? If so, would it be through bios, a key combo, or software?
    #2: Will accessories for the T520 be compatible with the T530? Including the 9-cell and the slice?
    #3: Because this is a new item, and there might be high demand, is there a possibility of shipments bottlenecking? I.E.: if I buy one right now, will my order get postponed multiple times and take months?
    Sorry if these answers have already been answered elsewhere, but I really did try (used Google and the forum search) to find the answers before posting. Plus, I'm sure there are a few people like me trying to decide between the T520 and Ivy-equipped T530, so maybe this thread will help them too.

    joshua144,
    This is a bit outside my area of expertise, but I don't think the slice battery from T420/T520/W520 generation will work on the new systems like T430/T530/W530 which require battery authentication.
    Check the tabook  http://www.lenovo.com/psref/pdf/tabook.pdf  to know which battery options are supported on which systems.  And note that the slice battery option for T520 is different than the slice battery option for T530.
    Just because the 28++ battery (from your link) is backwards-compatible with the older systems, does not mean the older batteries like 27++ are forward-compatible with the new systems.
    As for your other question about FN and CTRL, the FN button is still on the outside of the keyboard just like ThinkPad has always been.  And there is still the BIOS option to swap CTRL and FN.

  • Please Hilp me ( about linked list)

    i am an university student
    i was write a proram by ( arrays)
    thes program about Employees ( Add , Searsh , displly , delete )
    it is 6 class
    1 = Employee.java
    2 = Boss.java
    3 = CommissionWorker.java
    4 = HourlyWorker.java
    5 = PieceWorker.java
    6 = StartProgram.java
    i wona now changing the program from (Arrays) to (linked list)
    this is the cood

    The last 1
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class StartProgram extends JFrame
              // The Components For Frame 1
              private JLabel Label_Number_Of_Employee ;
              private JTextField Text_Number_Of_Employee ;
              private JButton Button_New, Button_Display, Button_Search, Button_UpData, Button_Delete;
              private JButton Button_Exit, Button_RE;
              private JPanel Panel_1_North, Panel_1_West, Panel_1_South, Panel_1_Center;
              // The Components For Frame 2
              private JLabel Label_Name, Label_Adress, Label_Gread, Label_ID, Label_Salary , Label_Commiss, Label_Quant, Label_Hour, Label_Wage, Label_Pice, Label_Total_Mony, Label_NumberID_FOR_Searsh;
              private JTextField TextField_Total_mony, TextField_Name, TextField_Adress, TextField_Greade,     TextField_ID, TextField_Salary , TextField_Commiss, TextField_Quant, TextField_Hour, TextField_Wage, TextField_Pice, TextField_NumberID_FOR_Searsh;
              private JButton Button_Clear, Button_OK2, Button_Cancel, Button_Next, Button_Prev, Button_Searsh, Button_Save, Button_Delet, Button_Create;
              private JRadioButton rad_Boss, rad_HourlyWorker, rad_PiceWorker, rad_CommissWorker;
              private ButtonGroup radGroup;
              private JPanel Panel_2_Center, Panel_2_South, Panel_2_North;
              // The Container For Frame 1
              Container cont;
              // The Container For Frame 2
              Container cont2;
              // The Layouts For Frame 1 & 2
              private FlowLayout layout;
              private GridLayout glayout;
              // private class Show_Frame2 extends JFrame
              int ID_Conter_Number[] = new int[1];
              Show_Frame2 Frame_Display;
              Show_Frame2 Frame_Delete;
              Show_Frame2 Frame_UpData;
              Show_Frame2 Frame_Search;
              // VARIABLES
              int Text_Number_TO_int = 0;
              int Countr_Index_Of_ArrayEmp = 0;
              int Number_Chose_Acion;
              int Conter_next = -1;
              int Number_Stop_Create = 0;
              int NumberID_FOR_Searsh = 0 ;
              int Nu_S_S_D_F_T_F_T_T_A; // use in Set_Save_Data_From_Text_Field_To_The_Arayy();
              int Number_Set_Kind_Employee; // use in Set_Save_Data_From_Text_Field_To_The_Arayy();
              int Nu_S_K_E_B_R_S; // use in Set_Kind_Employee_By_radBotton_Selected()
              int Nu_S_D_I_F_T_S_B_S_O_D; // use in Set_Data_in_Folds_To_Show_By_Searsh_Or_Disply()
              // use in Set_Save_Data_From_Text_Field_To_The_Arayy()
              int ID_set_Save_Data;
              int Greade_set_Save_Data;
              String Adress_set_Save_Data;
              String Name_set_Save_Data;
              double Salary_set_Save_Data;
              int Quant_set_Save_Data;
              int Hour_set_Save_Data;
              int Pice_set_Save_Data;
              double Wage_set_Save_Data;
              double Commiss_set_Save_Data;
              double Total_Mony;
              // For updata
              int ID_updata;
              int Greade_updata;
              String Adress_updata;
              String Name_updata;
              double Salary_updata;
              int Quant_updata;
              int Hour_updata;
              int Pice_updata;
              double Wage_updata;
              double Commiss_updata;
              double Total_Mony_updata;
              // Arayy(s) To Keep Elements Data Of Employee
              String ArayyName[];
              String ArayyAdress[];
              int ArayyGreade[];
              int ArayyID[];
              double ArayySalary[];
              double ArayyCommiss[];
              int ArayyQuant[];
              int ArayyHour[];
              double ArayyWage[];
              int ArayyPice[];
              int ArayyKind_Emp[];
              // Arayy(s)2 To Keep A Copy Of Elements Data Of Employee
              // Use in Delete Action
              String ArayyName_Copy[];
              String ArayyAdress_Copy[];
              int ArayyGreade_Copy[];
              int ArayyID_Copy[];
              double ArayySalary_Copy[];
              double ArayyCommiss_Copy[];
              int ArayyQuant_Copy[];
              int ArayyHour_Copy[];
              double ArayyWage_Copy[];
              int ArayyPice_Copy[];
              int ArayyKind_Emp_Copy[];
              // CONSRUCTOR of StartProgram class
              // Open form1
              public StartProgram()
                        super("Start To Employee System Control");
                        cont = getContentPane();
                        Panel_1_North = new JPanel();      Panel_1_North.setLayout(new GridLayout(3,0,0,0));
                        Panel_1_Center = new JPanel();          Panel_1_Center.setLayout(new GridLayout(6,0,0,0));
                        Panel_1_South = new JPanel();          Panel_1_South.setLayout(new GridLayout(1,0,0,0));
                        Label_Number_Of_Employee = new JLabel("Enter The Number Of Employees Then Press (ENTER) In Your KeyBoard ! ");
                        Text_Number_Of_Employee = new JTextField(10);
                        // 1- Display Button Choice To Employee System Control in form1
                        // 2- set Buttons Edit = false
                        Button_New = new JButton("Create a new an Employee(s) ");     Button_New.setVisible(false);
                        Button_Display = new JButton("Display an Employee(s) ");     Button_Display.setVisible(false);
                        Button_Search = new JButton("Search for an Employee(s) ");     Button_Search.setVisible(false);
                        Button_UpData = new JButton("UpData for an Employee(s) ");     Button_UpData.setVisible(false);
                        Button_Delete = new JButton("Delete an Employee(s) "); Button_Delete.setVisible(false);
                        // 1- Display Button ( EXIT & START AGEN ) in form1
                        // 2- set Buttons Edit = false
                        Button_Exit = new JButton("EXIT");     Button_Exit.setEnabled(false);
                        Button_RE = new JButton("START AGEN");     Button_RE.setEnabled(false);
                        // an object from the private class ActionHandler
                        ActionHandler handler = new ActionHandler();
                        Button_New.addActionListener(handler);
                        Button_Display.addActionListener(handler);
                        Button_Search.addActionListener(handler);
                        Button_UpData.addActionListener(handler);
                        Button_Delete.addActionListener(handler);
                        Button_Exit.addActionListener(handler);
                        Button_RE.addActionListener(handler);
                        Text_Number_Of_Employee.addActionListener(handler);
                        // Add all objects in form1
                        Panel_1_North.add(Label_Number_Of_Employee);
                        Panel_1_North.add(Text_Number_Of_Employee);
                        Panel_1_Center.add(Button_New);
                        Panel_1_Center.add(Button_Display);
                        Panel_1_Center.add(Button_Search);
                        Panel_1_Center.add(Button_UpData);
                        Panel_1_Center.add(Button_Delete);
                        Panel_1_South.add(Button_Exit);
                        Panel_1_South.add(Button_RE);
                        cont.add(Panel_1_North , BorderLayout.NORTH);
                        cont.add(Panel_1_Center , BorderLayout.CENTER);
                        cont.add(Panel_1_South , BorderLayout.SOUTH);
                        // setting of form1
                        setSize(450,350);
                        setVisible(true);
                        setResizable(false);
              } // END public StartProgram()
              private class ActionHandler implements ActionListener
                        public void actionPerformed(ActionEvent EEEE)
                                  // ================================================
                                  // ================================================
                                  // if user Put A Number Then He clock Enter
                                  if(EEEE.getSource() == Text_Number_Of_Employee)
                                            Set_Enter_Number_Of_Employee_Start();
                                  // ================================================
                                  // ================================================
                                  // Or if user clock Button Exit
                                  else if(EEEE.getSource() == Button_Exit)
                                            System.gc();
                                            System.exit(0);
                                  // ================================================
                                  // ================================================
                                  // if user clock Button RE START
                                  if(EEEE.getSource() == Button_RE)
                                            Set_Program_Start_Agen();
                                  // ================================================
                                  // ================================================
                                  // if user clock Button Create a new Employee
                                  if(EEEE.getSource() == Button_New)
                                            Number_Chose_Acion = 1;
                                            Show_Frame2 CCCC = new Show_Frame2();
                                  // ================================================
                                  // ================================================
                                  // if user clock Button Display The Employee
                                  if(EEEE.getSource() == Button_Display)
                                            Number_Chose_Acion = 2;
                                            Show_Frame2 CCCC = new Show_Frame2();
                                  // ================================================
                                  // ================================================
                                  // if user clock Button Search The Employee
                                  if(EEEE.getSource() == Button_Search)
                                            Number_Chose_Acion = 3;
                                            Show_Frame2 CCCC = new Show_Frame2();
                                  // ================================================
                                  // ================================================
                                  // if user clock Button UpData The Employee
                                  if(EEEE.getSource() == Button_UpData)
                                            Number_Chose_Acion = 4;
                                            Show_Frame2 CCCC = new Show_Frame2();
                                  // ================================================
                                  // ================================================
                                  // if user clock Button Delete
                                  if(EEEE.getSource() == Button_Delete)
                                            Number_Chose_Acion = 5;
                                            Show_Frame2 CCCC = new Show_Frame2();
                        } // END public void actionPerformed(ActionEvent e)
              } // END private class ActionHandler implements ActionListener
              public void Set_Enter_Number_Of_Employee_Start()
                        try
                                  Text_Number_TO_int = Integer.parseInt(Text_Number_Of_Employee.getText());
                                  if(Text_Number_TO_int <= 0)
                                            Text_Number_Of_Employee.setText("ERROR !! Please Enter a Number More Than 0");
                                  else
                                            Set_Create_Lingth_Of_Arayy_By_Number_That_Entered();
                        catch(NumberFormatException nfe)
                                  Text_Number_Of_Employee.setText("ERROR !! Please Enter a Number");
              public void Set_Create_Lingth_Of_Arayy_By_Number_That_Entered()
                        ID_Conter_Number = new int[Text_Number_TO_int];
                        Text_Number_Of_Employee.setEditable(false);
                        Button_New.setVisible(true);
                        Button_Display.setVisible(true);
                        Button_Search.setVisible(true);
                        Button_UpData.setVisible(true);
                        Button_Delete.setVisible(true);
                        Button_Exit.setEnabled(true);
                        Button_RE.setEnabled(true);
                        ArayyName = new String[Text_Number_TO_int];
                        ArayyAdress = new String[Text_Number_TO_int];
                        ArayyGreade = new int[Text_Number_TO_int];
                        ArayyID = new int[Text_Number_TO_int];
                        ArayySalary = new double[Text_Number_TO_int];
                        ArayyCommiss = new double[Text_Number_TO_int];
                        ArayyQuant = new int[Text_Number_TO_int];
                        ArayyHour = new int[Text_Number_TO_int];
                        ArayyWage = new double[Text_Number_TO_int];
                        ArayyPice = new int[Text_Number_TO_int];
                        ArayyKind_Emp = new int[Text_Number_TO_int];
              public void Set_Program_Start_Agen()
                        Text_Number_Of_Employee.setEditable(true);
                        Text_Number_Of_Employee.setText("");
                        Countr_Index_Of_ArrayEmp = 0;
                        Conter_next = -1;
                        Text_Number_TO_int = 0;
                        Countr_Index_Of_ArrayEmp = 0;
                        Conter_next = -1;
                        Nu_S_S_D_F_T_F_T_T_A = 0;
                        Number_Set_Kind_Employee = 0;
                        Number_Stop_Create = 0;
                        ArayyName = null ;
                        ArayyAdress = null ;
                        ArayyGreade = null ;
                        ArayyID = null ;
                        ArayySalary = null ;
                        ArayyCommiss = null ;
                        ArayyQuant = null ;
                        ArayyHour = null ;
                        ArayyWage = null ;
                        ArayyPice = null ;
                        ArayyKind_Emp = null ;
                        ArayyName_Copy = null ;
                        ArayyAdress_Copy = null ;
                        ArayyGreade_Copy = null ;
                        ArayyID_Copy = null ;
                        ArayySalary_Copy = null ;
                        ArayyCommiss_Copy = null ;
                        ArayyQuant_Copy = null ;
                        ArayyHour_Copy = null ;
                        ArayyWage_Copy = null ;
                        ArayyPice_Copy = null ;
                        ArayyKind_Emp_Copy = null ;
                        ID_set_Save_Data = 0;
                        Greade_set_Save_Data = 0;
                        Adress_set_Save_Data = null;
                        Name_set_Save_Data = null;
                        Salary_set_Save_Data = 0.00;
                        Quant_set_Save_Data = 0;
                        Hour_set_Save_Data = 0;
                        Pice_set_Save_Data = 0;
                        Wage_set_Save_Data = 0.00;
                        Commiss_set_Save_Data = 0.00;
              // Whin User Click Any rad Button
              private class RadHandler implements ItemListener
                        public void itemStateChanged(ItemEvent i)
                                  Set_All_Text_Field_To_Defolt_Text();
                                  TextField_Name.setEditable(true);
                                  TextField_Adress.setEditable(true);
                                  TextField_Greade.setEditable(true);
                                  if(i.getSource() == rad_Boss)
                                            TextField_Salary.setEditable(true);
                                            TextField_Wage.setEditable(false);
                                            TextField_Commiss.setEditable(false);
                                            TextField_Quant.setEditable(false);
                                            TextField_Hour.setEditable(false);
                                            TextField_Pice.setEditable(false);
                                  else if(i.getSource() == rad_HourlyWorker)
                                            TextField_Salary.setEditable(false);
                                            TextField_Wage.setEditable(true);
                                            TextField_Hour.setEditable(true);
                                            TextField_Commiss.setEditable(false);
                                            TextField_Quant.setEditable(false);
                                            TextField_Pice.setEditable(false);
                                  else if(i.getSource() == rad_PiceWorker)
                                            TextField_Salary.setEditable(false);
                                            TextField_Wage.setEditable(true);
                                            TextField_Hour.setEditable(false);
                                            TextField_Quant.setEditable(false);
                                            TextField_Commiss.setEditable(false);
                                            TextField_Pice.setEditable(true);
                                  else if(i.getSource() == rad_CommissWorker)
                                            TextField_Salary.setEditable(true);
                                            TextField_Wage.setEditable(false);
                                            TextField_Hour.setEditable(false);
                                            TextField_Quant.setEditable(false);
                                            TextField_Commiss.setEditable(true);
                                            TextField_Pice.setEditable(true);
              private class Show_Frame2 extends JFrame
                        public Show_Frame2()
                                  super("Control Panal Of Employee's Data");
                                  cont2 = getContentPane();
                                  Panel_2_Center = new JPanel();
                                  Panel_2_Center.setLayout(new GridLayout(11,2,5,5));
                                  Panel_2_South = new JPanel();
                                  Panel_2_South.setLayout(new GridLayout(2,5,5,5));
                                  Panel_2_North = new JPanel();
                                  Panel_2_North.setLayout(new GridLayout(2,1,5,5));
                                  Label_NumberID_FOR_Searsh = new JLabel("Employee's ID :", SwingConstants.RIGHT);
                                  Label_NumberID_FOR_Searsh.setVisible(false);
                                  TextField_NumberID_FOR_Searsh = new JTextField(5);
                                  TextField_NumberID_FOR_Searsh.setVisible(false);
                                  TextField_NumberID_FOR_Searsh.setEditable(false);
                                  Label_Name = new JLabel("Name : " , SwingConstants.RIGHT);
                                  Label_Adress = new JLabel("Address : " , SwingConstants.RIGHT);
                                  Label_Gread = new JLabel("Greade : " , SwingConstants.RIGHT);
                                  Label_ID = new JLabel("ID : " , SwingConstants.RIGHT);
                                  Label_Salary = new JLabel("Salary : " , SwingConstants.RIGHT);
                                  Label_Commiss = new JLabel("Commiss : " , SwingConstants.RIGHT);
                                  Label_Quant = new JLabel("Quant : " , SwingConstants.RIGHT);
                                  Label_Hour = new JLabel("Hours : " , SwingConstants.RIGHT);
                                  Label_Wage = new JLabel("Wage : " , SwingConstants.RIGHT);
                                  Label_Pice = new JLabel("Pice : " , SwingConstants.RIGHT);
                                  Label_Total_Mony = new JLabel("Total_Money : " , SwingConstants.RIGHT);
                                  TextField_Name = new JTextField(45);
                                  TextField_Adress = new JTextField(45);
                                  TextField_Greade = new JTextField(2);
                                  TextField_ID = new JTextField(4);
                                  TextField_Salary = new JTextField(10);
                                  TextField_Commiss = new JTextField(10);
                                  TextField_Quant = new JTextField(10);
                                  TextField_Hour = new JTextField(10);
                                  TextField_Wage = new JTextField(10);
                                  TextField_Pice = new JTextField(10);
                                  TextField_Total_mony = new JTextField(10); TextField_Total_mony.setEditable(false);
                                  rad_Boss = new JRadioButton("Boss" , false);
                                  rad_HourlyWorker = new JRadioButton("Hourly" , false);
                                  rad_PiceWorker = new JRadioButton("Pice" , false);
                                  rad_CommissWorker = new JRadioButton("Commiss" , false);
                                  radGroup = new ButtonGroup();
                                  radGroup.add(rad_Boss);
                                  radGroup.add(rad_HourlyWorker);
                                  radGroup.add(rad_PiceWorker);
                                  radGroup.add(rad_CommissWorker);
                                  //handler is object of private class RadHandler
                                  RadHandler rHandler = new RadHandler();
                                  rad_Boss.addItemListener(rHandler);
                                  rad_HourlyWorker.addItemListener(rHandler);
                                  rad_PiceWorker.addItemListener(rHandler);
                                  rad_CommissWorker.addItemListener(rHandler);
                                  Button_Save = new JButton("Save"); Button_Save.setVisible(false);
                                  Button_Delet = new JButton("Delete"); Button_Delet.setVisible(false);
                                  Button_Searsh = new JButton("Search"); Button_Searsh.setVisible(false);
                                  Button_Next = new JButton("next");
                                  Button_Prev = new JButton("Prev");
                                  Button_Clear = new JButton("Clear");
                                  Button_OK2 = new JButton("OK"); Button_OK2.setEnabled(false);
                                  Button_Cancel = new JButton("Cancel/Menu");
                                  Button_Create = new JButton("Create");
                                  // ================================================
                                  // ================================================
                                  // of usrt click Button Clear
                                  Button_Clear.addActionListener
                                            new ActionListener()
                                                      public void actionPerformed(ActionEvent e)
                                                                Set_Part_Of_Text_Field_Clear_of_Text();
                                  // ================================================
                                  // ================================================
                                  // of usrt click Button Cancel / Menu
                                  Button_Cancel.addActionListener
                                            new ActionListener()
                                                      public void actionPerformed(ActionEvent e)
                                                                setVisible(false);
                                  // ================================================
                                  // ================================================
                                  // 111111111111111111111111111111111111111111111111//
                                  // (Create new Employee)
                                  if (Number_Chose_Acion == 1)
                                            if (Number_Stop_Create >= Text_Number_TO_int)
                                                      JOptionPane.showMessageDialog(cont2, "You Can not add more Employees " , "Createing Will stop",JOptionPane.INFORMATION_MESSAGE);
                                            else
                                                      set_Show_Create_employees_Form();
                                  // ================================================
                                  // ================================================
                                  // 222222222222222222222222222222222222222222222222//
                                  // ( Display Employee)
                                  else if (Number_Chose_Acion == 2)
                                            if (ArayyName[0] == null)
                                                      JOptionPane.showMessageDialog(cont2,"Ther are No Employees to Display", "Exception Display",JOptionPane.ERROR_MESSAGE);
                                            else
                                                      set_Show_Display_employees_Form();
                                  // ================================================
                                  // ================================================
                                  // 333333333333333333333333333333333333333333333333//
                                  // ( Search Employee)
                                  else if (Number_Chose_Acion == 3)
                                            try
                                                      if (ArayyName[0] == null)
                                                                JOptionPane.showMessageDialog(cont2,"Ther are No Employees to Search", "Exception Search",JOptionPane.ERROR_MESSAGE);
                                                      else
                                                                set_Show_Search_employees_Form();
                                            catch (Exception ex)
                                                      JOptionPane.showMessageDialog(cont2,ex, "Exception",JOptionPane.ERROR_MESSAGE);
                                  // ================================================
                                  // ================================================
                                  // 444444444444444444444444444444444444444444444444//
                                  // ( UpData Employee)
                                  else if (Number_Chose_Acion == 4)
                                            try
                                                      if (ArayyName[0] == null)
                                                                JOptionPane.showMessageDialog(cont2,"Ther are No Employees to UpData", "Exception UpData",JOptionPane.ERROR_MESSAGE);
                                                      else
                                                                set_Show_UpData_employees_Form();
                                            catch (Exception ex)
                                                      JOptionPane.showMessageDialog(cont2,ex, "Exception",JOptionPane.ERROR_MESSAGE);
                                  // ================================================
                                  // ================================================
                                  // 555555555555555555555555555555555555555555555555//
                                  // ( Delete Action )
                                  else if (Number_Chose_Acion == 5)
                                            try
                                                      if (ArayyName[0] == null)
                                                                JOptionPane.showMessageDialog(cont2,"Ther are No Employees to Delete", "Exception Delete",JOptionPane.ERROR_MESSAGE);
                                                      else
                                                                set_Show_Delete_employees_Form();
                                            catch (Exception ex)
                                                      JOptionPane.showMessageDialog(cont2,ex, "Exception",JOptionPane.ERROR_MESSAGE);
                                  // ================================================
                                  // ================================================
                        } // END public Show_Frame2()
                        // 11111111111111111111111111111111111111111
                        public void set_Show_Create_employees_Form()
                                  set_Container_Of_Form2();
                                  setTitle("Create employees");
                                  setResizable(false);
                                  setSize(600,500);
                                  setVisible(true);
                                  Set_TextField_Editable_IS_FALSE();
                                  Conter_next = 0;
                                  // whin Fram Create new Employee loading
                                  Button_Next.setEnabled(false);
                                  Button_Prev.setEnabled(false);
                                  // of usrt click Button Create
                                  Button_Create.addActionListener
                                            new ActionListener()
                                                      public void actionPerformed(ActionEvent e)
                                                                // Kind of Employee that will ad is boss
                                                                if(rad_Boss.isSelected() == true)
                                                                          try
                                                                                    int Greade_N = Integer.parseInt(TextField_Greade.getText());
                                                                                    if ( (Greade_N > 99) || (Greade_N < 1) )
                                                                                                   JOptionPane.showMessageDialog(cont2," Please\nEnter Number in (Greade) Between 1 To 99", "ERROR NUMBER",JOptionPane.ERROR_MESSAGE);
                                                                                    else
                                                                                              Nu_S_S_D_F_T_F_T_T_A = Countr_Index_Of_ArrayEmp;
                                                                                              Number_Set_Kind_Employee = 1; // = Boss
                                                                                              Set_Save_Data_From_Text_Field_To_The_Arayy();
                                                                                              Set_All_Text_Field_To_Defolt_Text();
                                                                                              JOptionPane.showMessageDialog(cont2,Name_set_Save_Data + "\nwas Created As Boss", "Create",JOptionPane.INFORMATION_MESSAGE);
                                                                                              Countr_Index_Of_ArrayEmp ++;
                                                                                              Number_Stop_Create ++;
                                                                          catch(Exception ex)
                                                                                    JOptionPane.showMessageDialog(cont2,"Please Enter Correct Data\n"+ex, "Exception",JOptionPane.ERROR_MESSAGE);
                                                                // Kind of Employee that will ad is rad_HourlyWorker
                                                                if(rad_HourlyWorker.isSelected() == true)
                                                                               try
                                                                                    int Greade_N = Integer.parseInt(TextField_Greade.getText());
                                                                                    if ( (Greade_N > 99) || (Greade_N < 1) )
                                                                                              JOptionPane.showMessageDialog(cont2," Please\nEnter Number in (Greade) Between 1 To 99", "ERROR NUMBER",JOptionPane.ERROR_MESSAGE);
                                                                                    else
                                                                                              Nu_S_S_D_F_T_F_T_T_A = Countr_Index_Of_ArrayEmp;
                                                                                              Number_Set_Kind_Employee = 2; // = HourlyWorker
                                                                                              Set_Save_Data_From_Text_Field_To_The_Arayy();
                                                                                              Set_All_Text_Field_To_Defolt_Text();
                                                                                              JOptionPane.showMessageDialog(cont2,Name_set_Save_Data + "\nwas Created As HourlyWorker", "Create",JOptionPane.INFORMATION_MESSAGE);
                                                                                              Countr_Index_Of_ArrayEmp ++;
                                                                                              Number_Stop_Create ++;
                                                                          catch(Exception ex)
                                                                                    JOptionPane.showMessageDialog(cont2,ex, "Exception",JOptionPane.ERROR_MESSAGE);
                                                                // Kind of Employee that will ad is rad_PiceWorker
                                                                if(rad_PiceWorker.isSelected() == true)
                                                                          try
                                                                                    int Greade_N = Integer.parseInt(TextField_Greade.getText());
                                                                                    if ( (Greade_N > 99) || (Greade_N < 1) )
                                                                                              JOptionPane.showMessageDialog(cont2," Please\nEnter Number in (Greade) Between 1 To 99", "ERROR NUMBER",JOptionPane.ERROR_MESSAGE);
                                                                                    else
                                                                                              Nu_S_S_D_F_T_F_T_T_A = Countr_Index_Of_ArrayEmp;
                                                                                              Number_Set_Kind_Employee = 3; // = PiceWorker
                                                                                              Set_Save_Data_From_Text_Field_To_The_Arayy();
                                                                                              Set_All_Text_Field_To_Defolt_Text();
                                                                                              JOptionPane.showMessageDialog(cont2,Name_set_Save_Data + "\nwas Created As PiceWorker", "Create",JOptionPane.INFORMATION_MESSAGE);
                                                                                              Countr_Index_Of_ArrayEmp ++;
                                                                                              Number_Stop_Create ++;
        

  • Two quick questions about Library after moving beginning on a new computer

    Hi there,
    I just moved from Windows to Mac, meaning I had to move my iTunes library from the old PC to my new MBA.
    Just a couple of quick questions.
    1. When I started iTunes on my new Mac, in the preferences I directed the media folder to the folder with all my itunes music/podcasts etc, and then I imported the Library XML file.  Is this incorrect? Should I have imported a different file? Should I have used the itl file instead? 
    If so, should I delete the library and start again?  (if this is the case, please suggest the best way of doing this without affecting my media)
    - a kind of sub-question to this one:  some of the media files arent showing up in the iTunes library, but they are in the media folder on the ext HDD.  Is there a way I can find out which ones havent been recognized by iTunes?  Whats the best way of getting them in to my library?
    2. Pretty much half of my podcasts have not been loaded in the new iTunes.  The ones that havent were ones that I subscribed to on my iPhone, whereas the ones that show up in iTunes were ones I downloaded from iTunes.  When I connect my iPhone and sync it with iTunes, will those podcasts show up in iTunes?  Or is there a risk that they will be deleted from my iPhone?
    Cheers,

    The .xml is lacking some information such as ratings, date added, and play count.  Using the .itl includes this information but cannot be imported using the method you did.
    A complete library is everything in the iTunes folder.  By using the method you did you left the artwork behind in the artwork folder on the other machine.
    Selecting the media folder in preferences does not get iTunes to recognize the media.  All it does is tell iTunes to start storing new media in that location.
    Using the method I outlined nothing will be missed (with the exception of WMA) because you aren't rebuilding your library, you are using the one that already exists.
    You don't have to re-copy everything as long as you get the stuff you missed and re-assemble it all as it was before except not on the Mac.
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391

  • Quick question about Quicktime media keys.......

    I had a question about encoding video and media keys. It seems to me that the only codec that allows you to encode it with a media key is Sorenson (Sorenson 3 I think). Why are they the only ones that are enabling that in their codecs? Is it kind of a dying technology or practice? I've experimented with Sorenson 3 and Sorenson Squeeze trials and, even though it looks ok, it simply doesn't stack up to others like Apple's H.264 or open-source x264 or even Xvid. I guess I wish there were a way to be able to use media key options with all the new H.264 codecs. Is it possible to do that, either with Xcode or AppleScript? Any help would be greatly appreciated!!

    QuickTime has supported 'media keys" since version 3 but you can only add them using the third party software.
    You would be better served by contacting Sorenson and asking them about their support for newer codecs.

  • Quick Question about fade effect

    Quick Question:
    If I wanted to add a Fade Effect from one state to another
    when a button is pressed.
    How would I do that within the code?

    quote:
    Originally posted by:
    atta707
    You can do something like on the click of the button:
    var fader:Fade = new Fade(targetUIComponent);
    fader.duration = 1000;
    fader...;
    fader.play();
    or listen for currentStateChanging event and write the same
    similar code.
    or define transitions from one state to another like:
    <mx:Transition id="toOneOnly" fromState="*"
    toState="OneOnly">
    <mx:Sequence id="t1" targets="{[p2]}">
    <mx:Iris showTarget="false" duration="350"/>
    <mx:SetPropertyAction name="visible"/>
    <mx:SetPropertyAction target="{p2}"
    name="includeInLayout"/>
    </mx:Sequence>
    </mx:Transition>
    Hey,
    I would like to use the "transition from one state to
    another", but if you can explain each part for me that would be
    helpful.
    If you can comment on each line of that code that would help
    thanks

  • Quick question about showing drive space

    Hi,
    Just got a quick query about showing remaining drive space on the desktop.
    Before I wiped my Pismo and reinstalled Tiger (bad kernel panic), my hard drive and any other connected drives (pen drive, iPod, iDisk, etc) showed up on my Desktop with the name and drive capacity and remaining space underneath the icon.
    Now I've reinstalled, the drive capacity and remaining space don't show up on the Desktop, and I can't find how to turn it on. I've been through Preferences several times and can't find an obvious switch. Have I missed something? I'm running Tiger 10.4.8 with the machine spec below.
    Thanks in advance,
    Rob Johnson

    Sometimes, for no obvious reason, the Finder can be slow to update. And sometimes it updates instantly. Why? "Only the Shadow knows...." or maybe the Apple programmers.
    Francine
    Francine
    Schwieder

  • Quick question about sim transfer

    Hi all,
    I have a quick question and hopefully one of you guys would be able to help me. My friend purchased his 3g iphone today and hes giving me his old iphone. I currently have a blackjack and I wanted to take the sims card from the blackjack and put into the original iphone. Will the iphone work with my sims card? It is an older sims card, says 64k on it. If not, would I have to bring it into at&t and get it activated w/a different sims card? Hopefully all this isnt confusing. Thanks for any help. Cheers!

    You're welcome.
    I guess that also means I would have to upgrade to the 20 dollar data plan without the text messages as well?
    The unlimited data plan for the first generation iPhone still costs $20/mo and includes 200 SMS. The only thing you need to get from an at&t store is a new SIM card. Take the iPhone with you telling them what you plan on doing and they should give you a new SIM card at no cost.
    You will activate this iPhone with iTunes on your computer. If you are an existing subscriber, your calling plan will transfer to the iPhone, and any existing data plan you are using with your current phone will be cancelled. If you are an existing subscriber, your only selection will be the $20/mo unlimited data plan which includes 200 SMS, and you can select 1,500 SMS for an additional $10/mo or have unlimited SMS for an additional $20/mo.

Maybe you are looking for