Trying to create a simple example. Need Help!

I'm trying to create a very simlpe examlpe using Swing components to illustrate a MVC architecture.
I have a JFrame containing a JTree and a JButton.
What I'd like to happen is when I click the JButton the JTree model is changed in some fashion and the the view is refreshed due to the models change.
If anyone out there has a simple example of any MVC architecture involving Swing components I'd love to see it.
Thx

Sure, look at any of the Sun tutorials. For example, look in your API documentation for JTree; it has a link to a tutorial about how to use JTree.

Similar Messages

  • Premiere Pro CC updated  - crashes almost immediately on my mac OS X Yosemite 10.10.3. Crashes at startup, crashes with media import, crashes when creating a sequence. NEED HELP FAST I have tried many troubleshooting solutions I found online nothing has

    Premiere Pro CC updated  - crashes almost immediately on my mac OS X Yosemite 10.10.3. Crashes at startup, crashes with media import, crashes when creating a sequence. NEED HELP FAST> I have tried many troubleshooting solutions I found online nothing has worked.

    Hi,
    Sorry to hear about the experience. Please provide your computer configuration details.
    Memory, Processor, Graphics card, Exact version of Premiere Pro, Error message that you are get. If you can post screenshots of the error report that would be helpful.
    Thanks,
    Rameez

  • I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different p

    I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different place than where it is on frame 2. Confused!

    Hi Melissa - thanks for your interest. Here's the first frame, the second frame and the tween frame. I don't understand why the tween is changing the position of the object in frame 2, was expecting it to just fade from one frame to the next.

  • My ipod touch (2nd generation) is stuck on the usb to itunes screen.  I have NOT jailbroken it, and i have alsop tried restarting numerous times. I need help, soon!

    My ipod touch (2nd generation) is stuck on the usb to itunes screen.  I have NOT jailbroken it, and i have also tried restarting numerous times. I need help, soon! Itunes on my computer works about 50% of the time, so i feel lost!

    Download RecBoot and see if you can kick it out of recovery mode.
    Basic troubleshooting steps. 
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G + 120G OCZ Vertex 3 SSD Boot HD 

  • Simple Example Needed of JNLP launch

    Can someone please provide a simple HTML web page for launching the applet and also the associated JNLP file example that show HOW the applet is launched such that it starts/appears OUTSIDE the web browser. TIA.

    >
    Good, hard information instead of simply referring someone to "Google" would be a welcome change in these forums.If you had followed the link that Google represented ( http://www.google.co.uk/search?hl=en&q=jnlp+example&btnG=Google+Search&meta=&aq=f&oq= ) you would have seen that the 3rd result was a 'simple example' .
    So, should I just copy the content of the 3rd result? Should I plagiarize? Should I spend time creating a 'simple example'? In my view I should do none of these - I should simply point out that Google will find many 'simple example' .

  • I am un able to send mail as it gets stuck in my outbox. I am sure the solution is simple but need help?

    I am un able to send mail as it gets stuck in my outbox. This is a recent phenomena. I am sure the solution is simple but need help?

    I looked everywhere for a solution - and I finally figured it out! Deleting my accounts didn't work, but here is what worked. This worked when my Gmail accounts were not sending properly. I'm not sure if it works for other e-mail services.
    1. While in Mac Mail, click "Mail" in the top left corner of the screen
    2. Click "Preferences"
    3. Click "Accounts"
    4. Select your account that isn't sending properly
    5. In "Outgoing Mail Server (SMTP)" there will be two options - Gmail & Gmail (offline)
    Make sure that "Gmail" is selected and NOT "Gmail (offline)"
    If you navigate to another section in Preferences, it will ask you to SAVE - make sure you save your changes!
    It worked for me, hope it works for you!

  • Ok so I have a free standing iSight Cam, is it possible to use it with my white MacBook ? and if so how do I go about it ? I've tried researching for updates, drives but need help.

    Ok so I have a free standing iSight Cam, is it possible to use it with my white MacBook ? and if so how do I go about it ? I've tried researching for updates, drives but need help. Can someone give me some direction ?

    jpatricio787 wrote: ... is it possible to use it with my white MacBook ?...
    OK so yes, but if, and only if:
    (1) your MacBook has a Firewire port (not all do)
        - and -
    (2) your old external iSight camera works (not all do)
        - and -
    (3) your MacBook is working properly.
    If you are not certain whether your MacBook model has Firewire, you can search MacBook Technical Specifications for your model.  Alternatively, check the  User Guide Manual that came with your MacBook for the information you need to be certain.
    If you are not certain that your old external iSight camera works, you can test it using the suggestions in this link.
    jpatricio787 wrote: ... if so how do I go about it ? ...
    Follow the instructions in your iSight User's Guide to connect and turn on the iSight.  Then launch the Apple app you want to use with your iSight.  If you need more information about using an app, search for "camera" (without the quote marks) in the Help menu choice for the app.
    jpatricio787 wrote:... Can someone give me some direction ?
    If you need more direction, post back the specifics of what you still need.  We will offer further direction based on the details of your reply.
    Message was edited by: EZ Jim
    Mac OSX 10.9.3

  • Trying to create a simple database program.....help, please

    I am trying to create a database and I am having trouble gettig my code correct..........I think I am on the right track but I haven't a clue from this point, can anyone point me in the right direction as far as getting my program to have a master file and a transaction file and be able to manipulate the data........records.
    import java.awt.*;
    import java.applet.*;
    public class recordsApplet
    // Declare variables
    String lstName;
    String frstName;
    Int socSec;
    String street;
    String city;
    String state;
    Int zip;
    float rate;
    Int numofdep;
    //The buttons =
    Button Submit = new Button("Add");
    Button Change = new Button("Change");
    Button Delete = new Button("Delete");
    submit.addActionListner(this);
    Change.addActionListener(this);
    Delete.addActionListener(this);
    //get input from users
    System.out.println("Last Name:")
    lstName = dataIn.readline();
    System.out.println("First Name:")
    frstName = dataIn.readline();
    System.out.println("Social Security #:")
    socSec = dataIn.readline();
    System.out.println("Last Name:")
    street = dataIn.readline();
    System.out.println("Last Name:")
    city = dataIn.readline();
    System.out.println("Last Name:")
    state = dataIn.readline();
    System.out.println("Last Name:")
    zip = dataIn.readline();
    System.out.println("Rate of Pay:")
    rate = dataIn.readline();
    System.out.println("Number of Dependants:")
    numofdep = dataIn.readline();
    public void main(String[] args)
    //store the information in a text file
    try
    output = DataOutputStream(new FileOutputStream("mocdb.txt"));
    catch(IOException er)
    system.exit(0)
    //Print fields to text file
    String arg = e.getActionCommand();
    String code;
    if (arg == "Submit")
    code = "A";
    elseif
    code = "C";
    else
    code = "D";
    try
    output.writeUTF(code);
    output.writeUTF(lstName.getText());
    output.writeUTF(frstName.getText());
    output.writeUTF(socSec.getText());
    output.writeUTF(street.getText());
    output.writeUTF(city.getText());
    output.writeUTF(state.getText());
    output.writeUTF(zip.getText());
    output.writeUTF(rate.getText());
    output.writeUTF(numofdep.getText());
    catch(IOException c)
    System.exit(1);
    //Retrieve record from file
    System.out.println("Last Name:")
    lstName = dataIn.readline();
    System.out.println("First Name:")
    frstName = dataIn.readline();
    try
    record = new DataInputStream(new FileInputStream("mocdb.txt");
    catch(IOException c)
    system.exit(2)
    //Check first and last name and get file
    //Change data in file
    //Delete the data in file

    Sorry, but your question has nothing to do with JavaHelp. Please use another forum.
    /Mauritz

  • Can't create Word Document report - need help

    Hi,
    I have been trying to create a report using a word document. I downloaded an example from ni.com that has Export_Info.vi. When I try to run it I get this error:
    Error 1003 occurred at Open VI Reference in New Report.vi->Export_Info.vi
    I traced the error back to New Report.vi which is a VI that comes with the LabView package. There is a Open VI reference that when it tries to open Word_Open.vi gives an error. So for some reason I can not open Word_Open.vi without an error, and it comes with the Report generation office library.
    Does anyone know what could the problem be?
    I tried reinstalling everything and i still keep getting the same error. This makes it impossible to create a report now.
    Any help would be VERY appreciated.
    Thank you

    Yes I have it installed. When I went to open up Word_Open.vi it opened with an error and it said that the property was not valid.
    I attached a screenshot of the block diagram for Wor_Open.vi with an error message.
    Thank you
    Attachments:
    word open.jpg ‏115 KB

  • Help, I am killing myself trying to do this and I need help ASAP

    I need help with this program it has to act like a cash register. The user will input an items price and then their payment. It will tell you the change and then tell you what kinda of change to use, see example below:
    Use JOptionPane to take inputs from the user and display the results.
    Example:
    If the user enters
    Amount Due = 5.52 // First Input from the User
    Amount Given = 10.00 // Second Input from the User
    Calculate the Balance Due
    Balance Amount = $ 4.48
    and display the balance due in denomination as (The following four lines will be ONE Output to the user)
    $1 bill = 4 (4.00)
    Quarters = 1 (0.25)
    Dimes = 2 (0.20)
    Pennies = 3 (0.03)
    This last part, where you display the change that will be given back, ie: how many quarters, dimes, nickels, pennies is the part I am having problems with.
    Can some one help? Please pardon my coding abilities, I am still learning how to do this and would really appreciate any help you can with my program.
    Thanks in advance.
    import javax.swing.*;
    import java.text.*;
    public class CashReg
    { //Start
    public static void main (String [] args)
    { //Start Main
    int count = 0;
    char c1 = 0;
    String price = null;
    String payment = null;
    String change = null;
    boolean correct = false;
    while(!correct)
    { //Start Loop
    price = JOptionPane.showInputDialog (null,"Enter the amount of the item for purchase");
    if (price.length() < 1) //Loop
    JOptionPane.showMessageDialog (null, "You did not enter a purchase amount, try again please.");//Error message
    payment = JOptionPane.showInputDialog (null,"Enter your payment amount.");
    if (payment.length() < 1) //Loop
    JOptionPane.showMessageDialog (null, "You did not enter a payment amount, try again please.");//Error message
    else
    correct = true; //Boolean to confirm that there are enough characters
    for (int i=0; i<price.length(); i++)
    if (Character.isUpperCase(price.charAt(i)))
    count++;
    } //End loop
    // response = price - payment;
    JOptionPane.showMessageDialog (null, "You item costs "+price+" and you payed "+payment+" and your change will be "+change);
    System.exit(0);
    } //End Main
    } //End

    OK, thanks for your help, but I need some more. I have the program running and showing the amount of change that is going to be returned. But I don't know how to display the kind of change. AKA, quarters, dimes, nickels and pennies. I am a programming idot, my teacher is letting us twist in the wind. He is not explaining the concepts behind any of this. You are saying the word "logic" and I don't know what that means. This assigment is due Monday, I just need some help with the last part. How to show the change. I am just plain lost. please help.
    import java.text.DecimalFormat;
    import javax.swing.*;
    import java.text.*;
    public class CashReg
    {     //Start
         public static void main (String [] args)
         {          //Start Main
              int count = 0;
              char c1 = 0;
              String price = null;
              String payment = null;
              String change = null;
              boolean correct = false;
         while(!correct)
         {          //Start Loop
         price = JOptionPane.showInputDialog (null,"Enter the amount of the item for purchase");
              if (price.length() < 1)     //Loop
                   JOptionPane.showMessageDialog (null, "You did not enter a purchase amount, try again please.");//Error message
                   payment = JOptionPane.showInputDialog (null,"Enter your payment amount.");
              if (payment.length() < 1)     //Loop
                   JOptionPane.showMessageDialog (null, "You did not enter a payment amount, try again please.");//Error message
              else
                   correct = true; //Boolean to confirm that there are enough characters
    for (int i=0; i<price.length(); i++)
              if (Character.isUpperCase(price.charAt(i)))
              count++;
         }     //End loop
    //     response = price - payment;
    float fPrice = Float.parseFloat(price);
    float fPayment = Float.parseFloat(payment);
    float fChange = fPayment-fPrice;
    DecimalFormat df = new DecimalFormat ("#.00");
    JOptionPane.showMessageDialog (null, "You item costs "+price+" and you payed "+payment+" and your change will be "+ df.format (fChange));
    This is where I don't know what to put
         System.exit(0);
         }     //End Main
         }     //End
    I am begging for help.

  • HT4972 Im trying to download ios 5. Need help.

    Hello. I need help. I'm trying to download the latest version of itunes to my phone.

    To update from iOS 4 to iOS 5... See Here...
    http://support.apple.com/kb/HT4972
    If you already have iOS 5... See Here...
    How to update your iPhone, iPad, or iPod touch

  • I have tried to upgrade my iPod touch , and cant even remember to which iOS  , and it didnt respond with the upgrade and does the loading logo until the battery life is gone. I tried restarting it doesnt work. NEED HELP

    I have upgraded my iPod touch and it didnt respond to the upgrade. Cant remember which iOS i was upgrading but when i try to switch it on the apple logo comes up but than it just goes to the loading logo until the battery life is gone. I have tried restarting it , that doesnt work. I need help i am lost without my ipod please help. Any ideas besides restarting it ?

    Try:                           
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     

  • Can anyone help me, my mac book pro wont stop loading on the password screen. ive tried everything but nothings working! need help ASAP

    need help with MAC Book Pro! stuck on loading the password screen!

    Do you mean after you log in, it just gets stuck?
    Do the #6 Step here to reset your User Permisisions and see if that works.
    Step by Step to fix your Mac

  • HT201401 okey so i have an iphone4 and my camera isnt working at all i tried front and back screen  still black... it only works when im at my nessages.. but my frony dont. i have tried everything... please i need help.

    okey i have tried calling apple support no one will help me i stayed on the phone waiting an HOUR!! i tried turning my phone off and restarting it.. deleting pictures!! everything!!

    Sounds like your battery is not taking a charge, I know it shows full with you plug it in.  Try plugging it into a wall socket for a few hours and see if the iPod will work on battery power. 

  • I bought a SDHC card trying to put music on it need help

    need help putting music on a SDHC card

    Copy and paste or you need to be more specific about the trouble you are having. By the way, where did the music come from?

Maybe you are looking for

  • Air 3.5 front camera issue

    I am using the latest air 3.5 sdk to build an video application. But I find that the front camera can not render correctly in spark.VideoDisplay, while the back camera is ok. My deivce is galaxy nexus, android 4.1.2, the code is below: protected func

  • Pre Data Transfer Assistent Crashes

    I guess I'd describe the situation for mac users with Pre's as dire at this point. I have a mobile me account and it's not supported (I guess missing sync will handle that). Right now, I can't even get my numbers over with the data transfer assistant

  • Problem Importing .SCR Subtitles

    I've got a .SCR (Scenarist) subtitle file I'm trying to import into my DVD Studio Pro 4 project - and it refuses to import - providing this error message: "No corresponding subtitles found. The video asset timecode may not correspond with the timecod

  • Can I lose the 'back' arrow in my submenu?

    I like iDVD 6 but the only thing that seems a bit unprofessional is that silly looking back arrow in any submenu. Can I lose that in any way, leaving just the title button to lead back to the main menu? Or could I at least change the color to black (

  • DPS Desktop tools update (Cs6 2.06) issues

    Hi, I have recently be asked to update Folio Builder panel, I have download the new version, but when I try to update one of my folios in the cloud Indesign stop working. Any solution?