Difference between JDialog and a new window

Hello,
I have GUI window which contain maybe 10 buttons, and for each of them I add an event listener. When different button clicked, it open a new window which allow user to enter some value. I didn´t use dialog, I did like :
Button1.setFont(new java.awt.Font("Arial", 0, 12));
Button1.setText("Button1");
getContentPane().add(Button1, new FlowLayout());
Button1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Button1ActionPerformed(evt);
public void Button1ActionPerformed(java.awt.event.ActionEvent evt){   
new window1();
public class window1 extends JFrame {
// this class is a new window not a dialog.
// add some buttons and textField so user can enter some number to text field.
Button 1 --> open window 1
Button 2--> open window 2
Button 3-->open window 3
My problem is, only one button works. Button 2 and 3 are not working even I did the same thing to them as button 1. Do you think I should change window1 into dialog?
I have also problem with netBeans. My netBeans seems always remember my old executed code. For example if I delete button 1 listener, and run it. Button 1 still works even the code not existing anymore. Has anybody experience the same. I am really angry about this issue. Can anybody help me?
Thanks in advance!
Clare

hello,
Where can I set this Build Automatically property?
I didn´t use dialog, instead I create a new frame. here is code.
import javax.swing.*;
import java.awt.event.*;
import java.lang.Math.*;
public class Class2 extends JFrame{
      JTextField text1= new JTextField(20);
      JTextField text2 = new JTextField(20);
      JTextArea text3 = new JTextArea(5,8);
      JLabel label1 = new JLabel();
      JLabel label2 = new JLabel();
      JLabel label4 = new JLabel();
      JLabel label5 = new JLabel();
      JButton showResult = new JButton();
      JButton ok = new JButton();
       public Class2(Class1 c){
      cl = c;
      setSize(400,300);
      setTitle("Class2");
      getContentPane().setLayout(new FlowLayout());
      label1.setFont(new java.awt.Font("Arial", 0, 12));
      label1.setText("Total ");
      getContentPane().add(label1, new FlowLayout());
       text1.setFont(new java.awt.Font("Arial",0,12));
      text1.setBounds(5, 8, 5, 5);
      text1.setEditable(true);
      getContentPane().add(text1, new FlowLayout());
       // add text field2
      text2.setFont(new java.awt.Font("Arial",0,12));
      text2.setBounds(5, 8, 5, 5);
      getContentPane().add(text2, new FlowLayout());
      text2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                text2Performed(evt);
      label2.setFont(new java.awt.Font("Arial", 0, 12));
      label2.setText("Press enter");
      label2.setToolTipText("Press Enter");
      getContentPane().add(label2, new FlowLayout());
      label4.setFont(new java.awt.Font("Arial", 0, 12));
      label4.setText("type number");
      getContentPane().add(label4, new FlowLayout());
      // add text field3
      text3.setFont(new java.awt.Font("Arial",0,12));
      text3.setBounds(5, 8, 5, 5);
      text3.setEditable(false);
      //text1.setText(Roadpeople);
      getContentPane().add(text3, new FlowLayout());
      label5.setFont(new java.awt.Font("Arial", 0, 12));
      label5.setText("Count ");
      getContentPane().add(label5, new FlowLayout());
      // add showResultButton
      showResult.setFont(new java.awt.Font("Arial", 0, 10));
      showResult.setToolTipText("show result");
      showResult.setLabel("show result");
      showResult.setMargin(new java.awt.Insets(2, 2, 2, 2));
      getContentPane().add(showResult, new FlowLayout());
      // add ok button
      ok.setFont(new java.awt.Font("Arial", 0, 10));
      ok.setToolTipText("ok");
      ok.setLabel("ok");
      ok.setMargin(new java.awt.Insets(2, 2, 2, 2));
      getContentPane().add(ok, new FlowLayout());
      setVisible(true);
       }Thanks

Similar Messages

  • How to  pass data between JDialog and its parent window ?

    Hi,
    I am new to swing. I want to know how pass data between a JDialog and its parent window.
    If you have any information please reply with example code.
    Thank You

    hi Encephalopathic ,
    I was looking for something like as it was given in the link provided by you.
    Thank you for reply It really helped me.

  • Difference between Jdialog and JFrame

    though i know one difference of these two top-level containers such that, Jdialog dont have the iconifying buttons like JFrame.I would like to know whether they have any other differences.If they have,please list out them.

    There is a subtle difference between these components. JFrame is a fully-functional Windows window, where as JDialog is a popup-sort-of window. That sounds pretty weak. Essentially, you should use a JFrame for the part of your program that is always visible (unless it's minimized), while JDialog's pop up when you need them, and disapear when you don't.

  • I have the original apple tv.  Works fine.  What's the difference between it and the new one that's only $99?

    I paid $250 for the first generation apple tv and wonder if there's any new features to make it worth upgrading to the latest apple tv.   What am I missing?
    Thanks, Tzipora

    The new one has no hard drive instead it has 8GB of solid state memory.
    You can't sync to it as a consequence.  It uses less energy, is smaller and doesn't get hot enough to fry an egg.
    You lose analogue video/audio out.  It's HDMI/optical only.
    No mopre iTunes LP/Extras functionality.  No sending audio to Airtunes speakers fro AppleTV.
    The new one has a more powerful processor and can handle 720p 30fps which the old one couldn't and higher bitrates.  It tends to be more responsive going through menus but I prefer ATV1's way of sorting things and interface in general.
    You lose the ability to up/downscale video output to anything other than 720p.  Output if fixed to 720p.
    It's still evolving.  To my mind it's more an iPhone/iPad accessory / iTunes rental vehicle with some US centric (on the whole) novelties - Netflix, American football feeds may appeal to US users, but no use if you can't get Netflix in your country.
    The game keeps changing and iCloud features will enhance it's functionality but currently possibly only in US.  iCloud may let users play their purchases across the internet rather than from local storage - could be gtreat if it works but only provided things remain available in the store.
    US had TV Show rentals as well as Movie rentals, but TV Show rentals have been scrapped.
    You couldn't purchase anything at all on it until recently, and that's probably only TV Shows and only in the US currently.  No browsing music or music videos.
    iphones/iPads can use the Airplay feature to send video/audio across wi-fi to the AppleTV but personally I'm not that impressed by it.
    Vimeo has been added recently to complement YouTube, Flickr, MobileMe (end of line anyway).
    It's a mixed bag really - suits some people down to the ground, has limitations for others.
    AC

  • What is the difference between avi and mov

    Hi FCP users,
    I am actually an audio guy, but I would like an answer on something.
    I work with Logic, and usually use quicktime movies when I am working to movies. But I am working with a client who is an Avid user and swears by avi files. Can someone explain to me the difference. My client explained to me that avi's are better than mov files. He claims their file sizes are bigger, so therefore there quality is better. He said there is some form of compression on quicktime movies which lessen the quality to avi, even if the mov is uncompressed apparently the quality is still less than an uncompressed avi. If this is not true, could someone give me the real big difference between the two.
    I thought is was more of a preference, like windows users prefer wav, and apple users like quicktime movies. Like with audio, there isnt a huge difference between aif and wav. Windows users prefer wav and apple users aif.
    Thanks in advance for any information.

    gazo wrote:
    The vid guy has sent me some files to work with. So I am working in Final Cut to edit some of the video, and then sending it back to him. He is working on PC with Avid. What is the best. Should I convert the avi files he has sent to me to mov files. Then pull these into FCP, and then export it out as avi for him. Or should I export out as mov, and then he converts them to avi when he pulls it into Avid on his PC? Very confusing which is the best procedure between Mac and PC.
    Thanks in advance for any help.
    This is a disaster in the making. You can avoid being part of the train wreck by either renting an Avid, going to live at his house, or telling him to get a Macintosh.
    You must find the lowest common denominator video format that will work on both of your systems. That could be conventional DV, dunno, never used Avid and never tried to edit anything on a PC. But I can tell you this with absolute certainty, it will be easier and, in the end, much less expensive for one of you to adopt the other's platform for the duration of this project. The time you waste transcoding, arguing, formatting your drives, buying secondary products, fitting round pegs into square holes, and trying to find a workable solution (that will keep changing as the project gets more complicated) will cost you much more in terms of money out of pocket and creative frustration than simply buying/renting another station.
    bogiesan

  • Major differences between GL and New GL concepts

    Hai,
    Please let me know the major differences between old and new gl concepts and if possible explain with few examples....
    Thanks in advance.....
    Regards
    Moderator: Please, read and respect SDN rules

    Hi
    Refer to the link below-
    http://www.sap.com/solutions/business-suite/erp/financials/pdf/BWP_New_Gen_Ledger_Acct_Functions.pdf
    Regards
    Milind

  • Difference between General Ledger Accounting (New) and Old

    Hello All,
    Please help me with the below:
    1)Could any one please explain the difference between General Ledger Accounting (New) and General Ledger Accounting (Old).
    After going through the help document I understood that the BI 7 version came up with General Ledger Accounting (New), If this is true then can we still use 0FI_GL_04 in Ecc and BI7.0?
    2)what is the difference between 0FI_GL_04 and 0FI_GL_14?
    3) Is there any material or link or pdf that explains more clearly about FI - GL implementation in BI.
    Thanks in advance.Your help will be much appreciated.

    Hi Kiran,
    Pl check SDN before Posting
    Diff. Between old and New GL :
    Using new oEhP3 FI or old FI datasources
    Extraction and Reporting of FI-CA: Open Items Data In SAP-BI:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a9996115-0b01-0010-b2b2-d9de0170a425?QuickLink=index&overridelayout=true
    Financial Accounting: Procedure for Delta Extraction of Transaction Figures:
    http://help.sap.com/saphelp_sm32/helpdata/en/41/4b73415fb9157de10000000a155106/content.htm
    Complete FI-GL Information :
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/FigL/FigL.pdf
    Regards
    Ram
    Edited by: Ramakanth Deepak Gandepalli on Jan 29, 2010 5:14 AM

  • Looking for new laptop what are the differences between pro and air? Besides size. Does the air preform like the pro?

    Looking for new laptop what are the differences between pro and air? Besides size. Does the air preform like the pro?

    The NEW macbook Pro and Air are EXTREMELY close in form factor
    The newest macbook Pro is essentially a larger macbook Air with Retina display and options for speed in increasing prices up to an independent graphics and quad core processor.
    both Air and new Pro now have PCIe SSD and permanent RAM.
    The Air is the lightweight portable form factor, fast to boot and shut down, but with longer battery life than any of the macbook pro in 13"
    Now the new macbook Pro and macbook Air are extremely close in form factor and nature.
    both have 802ac wifi
    both have permanent RAM, no superdrive
    both are slim profiles and SSD
    The only real differences now are (in the most expensive Pros) faster processors and quadcore processors and top end model autonomous graphics.
    ....and of course the retina display
    both are now "very good for travel"
    Other than features the form factor of the Air and Pro are VERY close now,....so now its merely a matter of features and price more than anything.
    You need an external HD regardless of what you get for backups etc.   Drop into an Apple store and handle both and make your choice based on features, such as Retina or non-retina, .... both at a distance now look like the same computer.
    The Pro weighs more, ....but nowhere near what it used to just a month ago on the older macbook Pros
    The NEW macbook Pro is a different creature entirely than the older macbook Pro, .....the new Pro is thicker than the Air, but id frankly call the NEWEST Pro a "macbook Air with Retina display" , or
    Maybe a “macbook Air PRO with Retina display” 
    Instead of Air VS Pro now,.....its really a smooth transition from Air to pro without comparing say, 2 different creatures, now its like contrasting a horse from a race horse.
    Either one in 8gig of RAM (preferably)... the 4gig upgrade costs very little,  the I7 you will notice only 15% faster on heavy applications over the I5, and NOTHING on most APPS.....I5 has longer battery life.
    As you see below, the non-Retina 13" AIR is 82% of the Macbook with Retina display in resolution
    there is no magical number of pixels per inch that automatically equates to Retina quality.
    http://www.cultofmac.com/168509/why-you-might-be-disappointed-by-the-resolution- of-those-new-retina-display-macs-feature/
    A huge internal SSD isnt a game changer for anything, you need an external HD anyway
    what you WONT READ on Apple.com etc. is that the larger SSD  are MUCH FASTER due to SSD density
    "The 512GB Samsung SSD found in our 13-inch model offers roughly a 400MB/s increase in write speeds over the 128GB SanDisk/Marvell SSD"
    http://blog.macsales.com/19008-performance-testing-not-all-2013-macbook-air-ssds -are-the-same
    Here is an excellent video comparison between the 11” I5 vs. I7 2013 Macbook Air.
    http://www.youtube.com/watch?v=oDqJ-on03z4
    http://www.anandtech.com/show/7113/2013-macbook-air-core-i5-4250u-vs-core-i7-465 0u/2
    I5 vs. I7 performance 13” Macbook Air 2013
    Boot performance
    11.7 I5 ……11.4 I7
      Cinebench 
    1.1 I5….1.41 I7
    IMovie Import and Opt.
    6.69 I5….5.35 I7
      IMovie Export 
    10.33 I5…8.20 I7
    Final Cut Pro X
    21.47 I5…17.71 I7
      Adobe Lightroom 3 Export 
    25.8 I5….31.8 I7
    Adobe Photoshop CS5 Performance
    27.3 I5…22.6 I7
    Reviews of the newest Retina 2013 Macbook Pro
    13”
    Digital Trends (13") - http://www.digitaltrends.com/laptop-...h-2013-review/
    LaptopMag (13") - http://www.laptopmag.com/reviews/lap...play-2013.aspx
    Engadget (13") - http://www.engadget.com/2013/10/29/m...-13-inch-2013/
    The Verge (13") - http://www.theverge.com/2013/10/30/5...ay-review-2013
    CNet (13") - http://www.cnet.com/laptops/apple-ma...-35831098.html
    15”
    The Verge (15") - http://www.theverge.com/2013/10/24/5...w-15-inch-2013
    LaptopMag (15") - http://www.laptopmag.com/reviews/lap...inch-2013.aspx
    TechCrunch (15") - http://techcrunch.com/2013/10/25/lat...ok-pro-review/
    CNet (15") - http://www.cnet.com/apple-macbook-pro-with-retina-2013/
    PC Mag (15") - http://www.pcmag.com/article2/0,2817,2426359,00.asp
    Arstechnica (15") - http://arstechnica.com/apple/2013/10...-pro-reviewed/
    Slashgear (15") - http://www.slashgear.com/macbook-pro...2013-26303163/

  • What is the difference between JFrame and JDialog?

    Is there any difference between JFrame and JDialog except that the JDialog can be modal?
    Is there any reason to use JFrame at all if i can achive the exactly the same with a JDialog?

    API wise they are basically the same, but they are usually built on top of different heavyweight components. Some platforms treat frames quite a bit differently than they do dialogs.

  • Difference between view and window ?

    Hi All,
    Can you tell me a basic difference between view and window , maybe you can correlate your answers with concepts of HTML.
    Rajeev

    Hi Rajeev,
    A window is a place for displaying your views. Your view is not available to the outside world. View is available only to your component. However, your window is an interface view, which can be displayed in other components.
    A view contains your UI elements. It has a layout (a window does not). A window contains embedded views.
    In the window, you can define how navigation between views takes place (by creating navigation links).
    Regards,
    Neha
    <i><b>PS: Reward if helpful</b></i>

  • Difference between "clone" and creating a new object

    Hi experts,
    What on earth is the difference between:
    1)creating a new object by using the "clone()" method and
    2) just creating a new object?
    Let me be a bit more specific:
    if there's a class called "Book" and suppose we've already created an object called "japaneseBook", any difference between "Book spanishBook = new Book();" and "Book spanishbook = japaneseBook.clone()"?
    Thank you.
    Eileen

    The purpose is very obvious. At anytime in the running application, when Objects have been changed, and you desire to make another one of the same kind, you can't use new. You would use clone. The newer Object would have the same values in the variables. Now i got a question.. an important issue.
    public class XYZ{   
      public static int t = 10;
    } // default constructor is present by default.
                     //In another portion i have the following..
    private XYZ x = new XYZ( );  // private Object!!
         // Now what about this one????
    public XYZ x1 = x.clone( );  // public !!, well
    What impact of this code can be there to break the rules of good OOP design??? Is it that a clone Object would have the same access of itself (not of its variables) or different one?????????

  • Differences between awt and swing

    Ive written the following code, however Ive implemented the gui in awt rather then swing. Ive been told it hs too be in swing. What is the difference between swing and awt what will I need to change in my program so that its done using swing rather then the awt? Heres the code:
    // pp.java
    // Grant Brown
    // 22/02/02
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    // =========================================================
    // Class: pp
    // This class drives the customer manager. It contains the
    // main method which gets called as soon as this application
    // begins to run.
    // =========================================================
    class pp extends Frame implements ActionListener
    // Container of customer objects
    private Vector customers = new Vector (100);
    // List of names component. (Must specify java.awt in
    // front of List to distinguish the List class in the
    // java.awt package from the List class in the java.util
    // package.)
    private java.awt.List names = new java.awt.List ();
    // Delete and update button components.
    private Button delete;
    private Button update;
    // Default constructor.
    public pp ()
    // Assign "Paper Round Manager" to title bar of frame window.
    super ("Paper Round Manager");
    // Add a listener that responds to window closing
    // events. When this event occurs (by clicking on the
    // close box in the title bar), save customers and exit.
    addWindowListener (new WindowAdapter ()
    public void windowClosing
    (WindowEvent e)
    saveCustomers ();
    System.exit (0);
    // Place an empty label in the north part of the frame
    // window. This is done to correct an AWT positioning
    // problem.
    Label l = new Label ();
    add ("North", l);
    // Place the names component in the center part of the
    // frame window.
    add ("Center", names);
    // Create a panel object to hold four buttons.
    Panel p = new Panel ();
    Button b;
    // Add an Insert button to the Panel object and register
    // the current pp object as a listener for button events.
    p.add (b = new Button ("Insert"));
    b.addActionListener (this);
    // Add a Delete button to the Panel object and register
    // the current pp object as a listener for button events.
    p.add (delete = new Button ("Delete"));
    delete.addActionListener (this);
    // The Delete button should be disabled until there is at
    // least one customer to delete.
    delete.setEnabled (false);
    // Add an Update button to the Panel object and register
    // the current pp object as a listener for button events.
    p.add (update = new Button ("Update"));
    update.addActionListener (this);
    // The Update button should be disabled until there is at
    // least one customer to update.
    update.setEnabled (false);
    // Add a Finish button to the Panel object and register
    // the current customer object as a listener for button events.
    p.add (b = new Button ("Finish"));
    b.addActionListener (this);
    // Add the panel object to the frame window container.
    add ("South", p);
    // Set the background of the frame window container to
    // lightGray
    setBackground (Color.lightGray);
    // Set the size of the frame window container to 400
    // pixels horizontally by 200 pixels vertically.
    setSize (400, 200);
    // Allow the user to resize the frame window.
    setResizable (true);
    // Load all contacts.
    loadCustomers ();
    // Make sure that the frame window is visible.
    setVisible (true);
    public void actionPerformed (ActionEvent e)
    if (e.getActionCommand ().equals ("Delete"))
    delete ();
    else
    if (e.getActionCommand ().equals ("Finish"))
    saveCustomers ();
    System.exit (0);
    else
    if (e.getActionCommand ().equals ("Insert"))
    insert ();
    else
    update ();
    public Insets getInsets ()
    // Return an Insets object that describes the number of
    // pixels to reserve as a border around the edges of the
    // frame window.
    return new Insets (10, 10, 10, 10);
    public static void main (String [] args)
    // Create a new pp object and let it do its thing.
    new pp ();
    private void delete ()
    // Obtain index of selected contact item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot update
    // a contact if no contact item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Remove the contact item from the names component.
    names.remove (index);
    // Remove the Customer object from the contacts Vector
    // object.
    customers.remove (index);
    // If there are no more customers ...
    if (customers.size () == 0)
    delete.setEnabled (false);
    update.setEnabled (false);
    else
    // Make sure that the first contact item in the names
    // list is highlighted.
    names.select (0);
    private void insert ()
    // Create an Insert data entry form to enter information
    // for a new customer.
    DataEntryForm def = new DataEntryForm (this, "Insert");
    // If the bOk Boolean flag is set, this indicates the user
    // exited the form by pressing the Ok button.
    if (def.bOk)
    // Create a Contact object and assign information from
    // the form to its fields.
    Customer temp = new Customer ();
    temp.name = new String (def.name.getText ());
    temp.publication = new String (def.publication.getText ());
    temp.round = new String (def.round.getText ());
    temp.address = new String (def.address.getText ());
    temp.phone = new String (def.phone.getText ());
    // Add a new customer item to the names component.
    names.add (temp.name + ", " + temp.publication);
    // Add the Customer object to the contacts Vector
    // object.
    customers.add (temp);
    // Make sure that the Delete and Update buttons are
    // enabled.
    delete.setEnabled (true);
    update.setEnabled (true);
    // Destroy the dialouge box.
    def.dispose ();
    // Make sure that the first customer item in the names list
    // is highlighted.
    names.select (0);
    // ===========================================================
    // Load all contacts from contacts.dat into the contacts
    // Vector object. Also, make sure that the last name/first
    // name from each contact is combined into a String object and
    // inserted into the names component - as a contact item.
    // ===========================================================
    private void loadCustomers ()
    FileInputStream fis = null;
    try
    fis = new FileInputStream ("Customers.dat");
    DataInputStream dis = new DataInputStream (fis);
    int nCustomers = dis.readInt ();
    for (int i = 0; i < nCustomers; i++)
    Customer temp = new Customer ();
    temp.name = dis.readUTF ();
    temp.publication = dis.readUTF ();
    temp.round = dis.readUTF ();
    temp.address = dis.readUTF ();
    temp.phone = dis.readUTF ();
    names.add (temp.name + ", " + temp.publication);
    customers.add (temp);
    if (nCustomers > 0)
    delete.setEnabled (true);
    update.setEnabled (true);
    catch (IOException e)
    finally
    if (fis != null)
    try
    fis.close ();
    catch (IOException e) {}
    // Make sure that the first contact item in the names list
    // is highlighted.
    names.select (0);
    // ========================================================
    // Save all Customer objects from the customer Vector object
    // to customer.dat. The number of customerss are saved as an
    // int to make it easy for loadCustomers () to do its job.
    // ========================================================
    private void saveCustomers ()
    FileOutputStream fos = null;
    try
    fos = new FileOutputStream ("customers.dat");
    DataOutputStream dos = new DataOutputStream (fos);
    dos.writeInt (customers.size ());
    for (int i = 0; i < customers.size (); i++)
    Customer temp = (Customer) customers.elementAt (i);
    dos.writeUTF (temp.name);
    dos.writeUTF (temp.publication);
    dos.writeUTF (temp.round);
    dos.writeUTF (temp.address);
    dos.writeUTF (temp.phone);
    catch (IOException e)
    MsgBox mb = new MsgBox (this, "PP Error",
    e.toString ());
    mb.dispose ();
    finally
    if (fos != null)
    try
    fos.close ();
    catch (IOException e) {}
    private void update ()
    // Obtain index of selected customer item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot update
    // a customer if no customer item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Obtain a reference to the customer object (from the
    // customers Vector object) that is associated with the
    // index.
    Customer temp = (Customer) customers.elementAt (index);
    // Create and display an update entry form.
    DataEntryForm def = new DataEntryForm (this, "Update",
    temp.name,
    temp.publication,
    temp.round,
    temp.address,
    temp.phone);
    // If the user pressed Ok...
    if (def.bOk)
    // Update the customer information in the customers
    // Vector object.
    temp.name = new String (def.name.getText ());
    temp.publication = new String (def.publication.getText ());
    temp.round = new String (def.round.getText ());
    temp.address = new String (def.address.getText ());
    temp.phone = new String (def.phone.getText ());
    // Make sure the screen reflects the update.
    names.replaceItem (temp.name + ", " + temp.publication,
    index);
    // Destroy the dialouge box.
    def.dispose ();
    // Make sure that the first customer item in the names
    // list is highlighted.
    names.select (0);

    Ive doen pretty much what you said burt now my program isnt working at all. The window comes up but instead of doing something when you click the button it just throws shit loads of exceptions. Heres my abridged code
    // pp.java
    // Grant Brown
    // 22/02/02
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    // =========================================================
    // Class:PP
    // This class drives the Paper Round manager. It contains the
    // main method which gets called as soon as this application
    // begins to run.
    // =========================================================
    class pp extends JFrame implements ActionListener
    // Container of customer objects (one object per customer)
    private Vector customers = new Vector (100);
    // List of names component. (Must specify java.awt in
    // front of List to distinguish the List class in the
    // java.awt package from the List class in the java.util
    // package.)
    private java.awt.List names = new java.awt.List ();
    // Delete and update button components.
    private JButton delete;
    private JButton update;
    // Default constructor.
    public pp ()
    // Assign Contact Manager to title bar of frame window.
    super ("Paper Round Manager");
    // Add a listener that responds to window closing
    // events. When this event occurs (by clicking on the
    // close box in the title bar), save contacts and exit.
    addWindowListener (new WindowAdapter ()
    public void windowClosing
    (WindowEvent e)
    saveCustomers ();
    System.exit (0);
    // Place an empty label in the north part of the frame
    // window. This is done to correct an AWT positioning
    // problem. (One thing that you'll come to realize as
    // you work with the AWT is that there are lots of bugs.)
    JLabel l = new JLabel ();
    getContentPane().add ("North", l);
    // Place the names component in the center part of the
    // frame window.
    getContentPane().add ("Center", names);
    // Create a panel object to hold four buttons.
    JPanel p = new JPanel ();
    JButton b;
    // Add an Insert button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (b = new JButton ("Insert"));
    b.addActionListener (this);
    // Add a Delete button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (delete = new JButton ("Delete"));
    delete.addActionListener (this);
    // The Delete button should be disabled until there is at
    // least one contact to delete.
    delete.setEnabled (false);
    // Add an Update button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (update = new JButton ("Update"));
    update.addActionListener (this);
    // The Update button should be disabled until there is at
    // least one contact to update.
    update.setEnabled (false);
    // Add a Finish button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (b = new JButton ("Finish"));
    b.addActionListener (this);
    // Add the panel object to the frame window container.
    getContentPane().add ("South", p);
    // Set the background of the frame window container to
    // lightGray (to give a pleasing effect).
    setBackground (Color.lightGray);
    // Set the size of the frame window container to 400
    // pixels horizontally by 200 pixels vertically.
    setBounds (50, 100, 400, 200);
    // Do not allow the user to resize the frame window.
    loadCustomers ();
    // Load all contacts.
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    // Make sure that the frame window is visible.
    setVisible (true);
    public void actionPerformed (ActionEvent e)
    if (e.getActionCommand ().equals ("Delete"))
    delete ();
    else
    if (e.getActionCommand ().equals ("Finish"))
    saveCustomers ();
    System.exit (0);
    else
    if (e.getActionCommand ().equals ("Insert"))
    insert ();
    else
    update ();
    public Insets getInsets ()
    // Return an Insets object that describes the number of
    // pixels to reserve as a border around the edges of the
    // frame window.
    return new Insets (10, 10, 10, 10);
    public static void main (String [] args)
    // Create a new cm object and let it do its thing.
    new pp ();
    private void delete ()
    // Obtain index of selected customer item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot update
    // a contact if no contact item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Remove the customer item from the names component.
    names.remove (index);
    // Remove the Customer object from the contacts Vector
    // object.
    customers.remove (index);
    // If there are no more customers ...
    if (customers.size () == 0)
    delete.setEnabled (false);
    update.setEnabled (false);
    else
    // Make sure that the first contact item in the names
    // list is highlighted.
    names.select (0);
    private void insert ()
    // Create an Insert data entry form to enter information
    // for a new contact.
    DataEntryForm def = new DataEntryForm (this, "Insert");
    // If the bOk Boolean flag is set, this indicates the user
    // exited the form by pressing the Ok button.
    if (def.bOk)
    // Create a Customer object and assign information from
    // the form to its fields.
    Customer temp = new Customer ();
    temp.name = new String (def.name.getText ());
    temp.publication = new String (def.publication.getText ());
    temp.address = new String (def.address.getText ());
    temp.round = new String (def.round.getText ());
    temp.phone = new String
              (def.phone.getText ());
    // Add a new customer item to the names component.
    names.add (temp.publication + ", " + temp.address);
    // Add the Customer object to the contacts Vector
    // object.
    customers.add (temp);
    // Make sure that the Delete and Update buttons are
    // enabled.
    delete.setEnabled (true);
    update.setEnabled (true);
    // Destroy the dialog box.
    def.dispose ();
    // Make sure that the first customer item in the names list
    // is highlighted.
    names.select (0);
    // ===========================================================
    // Load all customers from customers.dat into the customers
    // Vector object. Also, make sure that the last name/first
    // name from each contact is combined into a String object and
    // inserted into the names component - as a contact item.
    // ===========================================================
    private void loadCustomers ()
    FileInputStream fis = null;
    try
    fis = new FileInputStream ("customers.dat");
    DataInputStream dis = new DataInputStream (fis);
    int nCustomers = dis.readInt ();
    for (int i = 0; i < nCustomers; i++)
    Customer temp = new Customer ();
    temp.name = dis.readUTF ();
    temp.publication = dis.readUTF ();
    temp.address = dis.readUTF ();
    temp.round = dis.readUTF ();
    temp.phone = dis.readUTF ();
    names.add (temp.publication + ", " + temp.address);
    customers.add (temp);
    if (nCustomers > 0)
    delete.setEnabled (true);
    update.setEnabled (true);
    catch (IOException e)
    finally
    if (fis != null)
    try
    fis.close ();
    catch (IOException e) {}
    // Make sure that the first customer item in the names list
    // is highlighted.
    names.select (0);
    // ========================================================
    // Save all customer objects from the contacts Vector object
    // to customers.dat. The number of contacts are saved as an
    // int to make it easy for loadCustomers () to do its job.
    // ========================================================
    private void saveCustomers ()
    FileOutputStream fos = null;
    try
    fos = new FileOutputStream ("customers.dat");
    DataOutputStream dos = new DataOutputStream (fos);
    dos.writeInt (customers.size ());
    for (int i = 0; i < customers.size (); i++)
    Customer temp = (Customer) customers.elementAt (i);
    dos.writeUTF (temp.name);
    dos.writeUTF (temp.publication);
    dos.writeUTF (temp.address);
    dos.writeUTF (temp.round);
    dos.writeUTF (temp.phone);
    catch (IOException e)
    MsgBox mb = new MsgBox (this, "PP Error",
    e.toString ());
    mb.dispose ();
    finally
    if (fos != null)
    try
    fos.close ();
    catch (IOException e) {}
    private void update ()
    // Obtain index of selected customer item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot update
    // a customer if no customer item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Obtain a reference to the Customer object (from the
    // customer Vector object) that is associated with the
    // index.
    Customer temp = (Customer) customers.elementAt (index);
    // Create and display an update entry form.
    DataEntryForm def = new DataEntryForm (this, "Update",
    temp.name,
    temp.publication,
    temp.address,
    temp.round,
    temp.phone);
    // If the user pressed Ok...
    if (def.bOk)
    // Update the customer information in the customers
    // Vector object.
    temp.name = new String (def.name.getText ());
    temp.publication = new String (def.publication.getText ());
    temp.address = new String (def.address.getText ());
    temp.round = new String (def.round.getText ());
    temp.phone = new String (def.phone.getText ());
    // Make sure the screen reflects the update.
    names.replaceItem (temp.publication + ", " + temp.address,
    index);
    // Destroy the dialog box.
    def.dispose ();
    // Make sure that the first customer item in the names
    // list is highlighted.
    names.select (0);
    // ========================================================
    // Class: Customer
    // This class describes the contents of a business customer.
    // ========================================================
    class Customer
    public String name;
    public String publication;
    public String address;
    public String round;
    public String phone;
    // ==========================================================
    // Class: DataEntryForm
    // This class provides a data entry form for entering customer
    // information.
    // ==========================================================
    class DataEntryForm extends JDialog implements ActionListener
    // bOk is a boolean flag. When true, it indicates that
    // the Ok button was pressed to terminate the dialog box
    // (as opposed to the Cancel button).
    public boolean bOk;
    // The following components hold the text that the user
    // entered into the visible text fields.
    public JTextField name;
    public JTextField publication;
    public JTextField address;
    public JTextField round;
    public JTextField phone;
    public void actionPerformed (ActionEvent e)
    // If the user pressed the Ok button, indicate this
    // by assigning true to bOk.
    if (e.getActionCommand ().equals ("Ok"))
    bOk = true;
    // Destroy the dialog box and return to the point
    // just after the creation of the DataEntryForm object.
    dispose ();
    public DataEntryForm (JFrame parent, String title)
    // Call the other constructor. The current constructor
    // is used for insert operations. The other constructor
    // is used for update operations.
    this (parent, title, "", "", "", "", "");
    public DataEntryForm (JFrame parent, String title,
    String name, String publication,
    String address, String round,
    String phone)
    // Initialize the superclass layer.
    super (parent, title, true);
    // Choose a grid bag layout so that components can be more
    // accurately positioned. (It looks nicer.)
    setLayout (new GridBagLayout ());
    // Add appropriate first name, last name, phone, fax, and
    // email components to the current DataEntryForm container.
    // (Remember, DataEntryForm is a subclass of Dialog.
    // Dialog is a container. Therefore, DataEntryForm
    // inherits the ability to be a container.)
    addComponent (this, new JLabel ("Name: "), 0, 0, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.name = new JTextField (15);
    addComponent (this, this.name, 1, 0, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.name.setText (name);
    addComponent (this, new JLabel ("Publications: "), 0, 1, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.publication = new JTextField (15);
    addComponent (this, this.publication, 1, 1, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.publication.setText (publication);
    addComponent (this, new JLabel ("Address "), 0, 2, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.address = new JTextField (15);
    addComponent (this, this.address, 1, 2, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.address.setText (address);
    addComponent (this, new JLabel ("Round No "), 0, 3, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.round = new JTextField (15);
    addComponent (this, this.round, 1, 3, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.round.setText (round);
    addComponent (this, new JLabel ("Phone Number "), 0, 4, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.phone = new JTextField (15);
    addComponent (this, this.phone, 1, 4, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.phone.setText (phone);
    addComponent (this, new JLabel (""), 0, 5, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    addComponent (this, new JLabel (""), 1, 5, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    JButton b;
    // Add an Ok button to this container.
    addComponent (this, b = new JButton ("Ok"), 0, 6, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    b.addActionListener (this);
    // Add a Cancel button to this container.
    addComponent (this, b = new JButton ("Cancel"), 1, 6, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    b.addActionListener (this);
    // Set the size of the dialog window to 250 pixels
    // horizontally by 200 pixels vertically.
    setSize (250, 200);
    // Do not allow users to resize the dialog window.
    setResizable (false);
    // Make sure that the dialog window is visible.
    setVisible (true);
    private void addComponent (Container con, Component com,
    int gridx, int gridy,
    int gridw, int gridh, int fill,
    int anchor)
    // Get the current layout manager. It is assumed to
    // be a GridBagLayout object.
    LayoutManager lm = con.getLayout ();
    // Create a GridBagConstraints object to make it
    // possible to customize component positioning.
    GridBagConstraints gbc = new GridBagConstraints ();
    // Assign the x and y grid positions.
    gbc.gridx = gridx;
    gbc.gridy = gridy;
    // Assign the number of grid blocks horizontally and
    // vertically that are occupied by the component.
    gbc.gridwidth = gridw;
    gbc.gridheight = gridh;
    // Specify the component's resize policy (fill) and
    // the direction in which the component is positioned
    // when its size is smaller than available space (anchor).
    gbc.fill = fill;
    gbc.anchor = anchor;
    // Set the new constraints that the grid bag layout
    // manager will use.
    ((GridBagLayout) lm).setConstraints (com, gbc);
    // Add the component to the container.
    con.add (com);
    // ===========================================================
    // Class: MsgBox
    // This class displays a message box to the user. The message
    // is usually an error message. The user must press the Ok
    // button to terminate the message box.
    // ===========================================================
    class MsgBox extends JDialog implements ActionListener
    public void actionPerformed (ActionEvent e)
    // Terminate the dialog box in response to the user
    // pressing the Ok button.
    dispose ();
    public MsgBox (JFrame parent, String title, String msg)
    // Initialize the superclass layer.
    super (parent, title, true);
    // Store the msg argument in a Label object and add
    // this object to the center part of the dialog window.
    JLabel l = new JLabel (msg);
    add ("Center", l);
    // Create a Button object and add it to the south part
    // of the dialog window.
    JButton b = new JButton ("Ok");
    add ("South", b);
    // Make the current object a listener to events that
    // occur as a result of the user pressing the Ok
    // button.
    b.addActionListener (this);
    // Make sure that the Ok button has the focus.
    b.requestFocus ();
    // Do not allow users to resize the dialog window.
    setResizable (false);
    // Allow the layout manager to choose an appropriate
    // size for the dialog window.
    pack ();
    // Make sure that the dialog window is visible.
    setVisible (true);
    }

  • Office 2013 installed with KB2817430, windowsupdate still finds KB2850036. difference between KB2817430 and KB2850036

    Hi,
    I've made a silent Office 2013 installer with /admin and put SP1 MSP's in the updates folder.
    After deployment under installed updates it shows: Service Pack 1 for Microsoft Office 2013 (KB2817430) 32-Bit Edition
    But when I check for new updates, "ServicePack 1 for Microsoft Office 2013 (KB2850036) 32-Bit Edition" is ready for download and install.
    What is the difference between KB2817430 and KB2850036?
    It seems that I cannot download KB2850036 and also integrate it in the silent installation.
    Another question: Is the updates folder from Office only for servicepacks? or can I put also updates and patches MSP files in here? If yes then i've got a lot of files with the same name and different files sizes. For example After extracting SP1 I've got
    the file "proofsp-en-us.msp" which is 10MB and when extracting another patch also i've got a proof-en-us.msp and is 8MB.
    So which one need to go in the updates folder?
    Can anyone help me out?
    thanks

    Hi,
    As can be seen from below KB articles, KB2817430 only contains Service Pack 1 (SP1) for Office 2013, whereas KB2850036 also contains Service Pack 1 (SP1) updates for other Office 2013 related desktop products. For example, Microsoft Office 2013
    Language Pack, Project 2013, SharePoint Designer 2013, Office Proofing Tools 2013, etc.:
    https://support.microsoft.com/en-us/kb/2850036
    https://support.microsoft.com/en-us/kb/2817430
    So if you have any of these products on your computer, Windows Update might offer related updates to you.
    Regarding the Updates folder issue, you can put any Office software updates in it during the initial installation, such as service packs or hotfixes. A newer patch might make changes to a specific file, you can check the version number of that file, and keep
    the newer one in the folder.
    Here is the reference you will need:
    http://blogs.technet.com/b/office_resource_kit/archive/2011/05/05/using-the-updates-folder-to-deploy-software-updates-with-an-office-2010-installation.aspx
    (Note, it was created against Office 2010, however the steps should hold good for Office 2013)
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Difference between PC and mac?

    With the Intel-based macs, we can install Windows on a mac and run it as if it's running on a PC. That leads me to a question. What exactly is the difference between PC and mac? I know they are different on the OS, but that's just on a software level, which I don't think constitutes the difference. The hard drives are formatted differently on both machines, I know, but we can still use the same hard drive for both a PC or a mac, we just have to format it the right way. So what really is the main thing that constitutes the difference between a PC and a mac? Putting it this way, I can run PC on a mac, can I do it the other way round? Can I install a Mac OS 10.5 on a pure PC made by companies like hp or Dell (or I can easily make one on my own) with an Intel Core 2 Duo/Quad processor, and run the machine like it's a mac?

    Allan Eckert wrote:
    While some have managed to hack things so that they can install OS X on a PC, the results have been not very reliable. Generally OS X has many part that do not function properly.
    It doesn't work well because the Mac hardware itself is different from what is found in any other Intel-based computer. Even the CPU's & support chips are not off-the-shelf Intel parts but variants optimized for Macs that are not available to other computer makers or to DIY enthusiasts.
    This is probably why for a time in 2007 the 'fastest Windows notebook on earth' was a MacBook Pro, as tested by PC World, a fact touted for a while in Apple TV ads. (It lost that title to a more conventional Wintel laptop about a month later, but the new champ cost over $5000, had "almost nonexistent" battery life, & weighs over 11 pounds, which should give you some idea of the advantages an Intel-Apple collaboration has over the competition.)

  • Exact  difference between se09 and se10

    Hi all,
    i want to know the exact difference  between se09 and se10  .
    i know
    SE09 is the workbench transport requests transaction - here the developers can track changes to all ABAP workbench objects (dictionary, reports, module pools, etc). This is a developer-specific transaction and mostly all developers have access to this transaction.
    SE10 is the customizing request display transaction - this displays all the customizing requests in the system. Again, this could be restricted to Business analysts if required, since they would be doing most of the customizing changes in the system.
    but i think this is not the correct answer which is  already appear in the thread list
    recently sombady has answer like the one which i have mentioned above but the interviwer said that this is wrong.
    CAN ANYONE TELL ME THE EXACT ANSWER AND HELP ME OUT.
    Regards
    fareed

    Hi Fareed,
      First of all, i would say its a nice obsevation. As soon as i saw your post i started checking both transactions in seperate window and i found something interesting.
    My Observation is as follows:-
    <b>When we create a Transaction, apart from the Transaction Name, Program Name, Screen Number etc., we also can give someting called "AUTHORIZATION FOR CALLED TRANSACTIONS", under the menu: UTILITIES of the window.
    Also we can use TRANSACTION:SE97, Maintain Transaction call Authorization in CALL TRANSACTION. Here we maintain the list of TRANSACTION CALLED for our Calling Transaction.
    Now if you see, this list for Transaction SE09 and SE10, The Authorization for Called Transaction Differs a lot. Hence the difference bettween SE09 and SE10 is mainly the AUTHORIZATION Objects.</b>
    <b>NOTE:</b> This is my own observation, so there are chances of misinterpretation from my side, accounting to the human err. But this is something new to me too.
    Thanks and regards,
    RAVI :).
    PLEASE AWARD POINTS IF YOU FEEL MY SOLUTION TO YOUR QUESTION IS RIGHT $-).

Maybe you are looking for

  • Exchange rate differences take to long to run

    I have a problem when I try to run the exchange rate differences, the screen take shows the accounts that I can revaluate takes like 3 hours in order to appears, so I don't know is this is normal, 'cause I have others databases that shows me the scre

  • What Happens When Premium Expires

    As most of you probably know Skype offered the free 6 month premium membership when you set up the Skype App on your Xbox One.  My question is once this 6 months expires does Skype automatically renew your subscription or will they prompt you to rene

  • Help Required on Comparison of Holt Winters with other Forecasting techn

    Hello, I have implemented Holt Winters Algorithm to forecaste various matrics like RTT, Throughput over the network. I want to compare my results with some other forecasting algorithm that work for such time series data. Can some body provide me with

  • Unable to unlock my iPhone 4

    Hi, I have iPhone 4 BB 02.10.04 and i want to unlock it. The iPhone is not under any contract and supposed to be free , i got it from a friend who lives in Australia. The iPhone was bought from Telstra cellular provider in Australia. I appreciate you

  • Can't download anything with blackberry torch 9810

    got a new phone about a year ago and can't download anything. I was told to sot set it back, update it, etc but it doesn't work. any ideas?