Need opinions       Jbutton, JLabel, or JToggleButton?

I want to have an image in a JPanel and have that image change between true and false. IE when true show one image and when false show another. I've had moderate success using a Jlabel but I have read that changing a Jlabels image dynamically isn't desirable.
What do you think?

Still, wouldn't a card layout be a good way to do
this? It seems that that is what card layout is
designed for. Or would just switching the icon on the
component be more efficient?I guess it depends a little on exactly what the users wants to do. But yes, you're right, this sounds like a potential match for the CardLayout.
I don't know how it compares with regard to efficiency though, but I would be surprised if it's an issue.

Similar Messages

  • Adding Dynamic JButtons & JLabels on the JTool

    On occerance of certain ActionEvent i need to add dynamic JButtons & JLabels on the JToolBar. Initially JToolBar will be empty.
    Code below is not working properly...
    It is creating buttons dynamiclly but i cant set any property for that one.
    class DeviceAction extends AbstractAction
         public DeviceAction()
         // Add this action to the toolbar resulting
         // in a new button getting added to the
         // toolbar
         JButton jbutton = xmlFilesToolBar.add( this);
         xmlFilesToolBar.addSeparator();
         jbutton.setActionCommand( "Dynamic" );
    I will call " new DeviceAction(); " when ever ActionEvent occurs.
    I need to have controle over the dynamically added JButtons & JLables, bcoz each JButtons shld do some Actions when it is clicked.
    Plz do the needful.
    Reg,
    Bha.

    Multi-post: http://forum.java.sun.com/thread.jspa?threadID=725394&tstart=0

  • My new Pc Build for Premiere Pro Editing. Need opinions!

    I have finally saved up enough money for my own Pc build and i need opinions on my parts list. My budget is aprox. $1800-$2000. This is a list I got from a local retail store, prices are taken from Pcpartpicker.
    This pc's main use will be editing in Premiere, Photoshop and After Effects, with some Gaming. Also, should I stick with Windows 7 Pro?
    Do you guys think this is a good build for the price range? Is there anything i should change?
    Many thanks for taking the time to read!
    CPU
    Intel Core i7-4770K 3.5GHz Quad-Core
    $307.27
    Motherboard
    Gigabyte GA-Z87X-UD3H ATX LGA1150
    $159.99
    Memory
    Kingston 16GB (2 x 8GB) DDR3-1600
    $119.98
    Storage
    Crucial M500 240GB 2.5" SSD
    $174.29
    Seagate Barracuda 3TB 3.5" 7200RPM
    $139.99
    Video Card
    Gigabyte GeForce GTX 660 2GB
    $193.98
    Sound Card
    Creative Labs SB X-Fi Xtreme Audio
    $49.99
    Case
    Cooler Master HAF XM (Black) ATX Mid Tower
    $94.00
    Power Supply
    Corsair 750W ATX12V
    $73.98
    Optical Drive
    Asus BW-14D1XT Blu-Ray/DVD/CD Writer
    $84.99
    Operating System
    Microsoft Windows 7 Professional SP1 (OEM) (64-bit)
    $124.00
    Total:  $1522.46

    joshweiland wrote:
    What's the bad part? Multiple drives or RAID'ing them?
    The bad part that Jim refers to is RAID 0-ing them: If only one of those drives goes bad, all of the data on both or all of the drives in that volume get permanently and irrecoverably lost (unless one wants to spend tens or even hundreds of thousands of dollars per disk just for professional data recovery).
    On the other hand, the only major disadvantage of multiple smaller drives is that they tend to cost more money overall than one larger drive. What's more, some of the smaller-capacity drives are still of older platter layout designs that are significantly slower in sequential speed than most of the larger-capacity drives (and even those that spin at only 5400 RPM instead of 7200 RPM).

  • Showing palette containing JButton,JLabel,JPanel ... components

    hello, I have created a simple application using jdeveloper, this application contains a simple project then I have created a simple JFrame but when I try to add somes components like JButton, JLabels I didn't
    find the palette from which I can add this components. please help me
    Best Regards.

    1) Create a new java Desktop Application
    2) An Application is created with a project named Client
    3) create a new frame/Dialog based on Client Tier(Swing/AwT).
    Select the newly created file and in the component palette, you would see the required components.
    Thanks,
    Navaneeth

  • Need opinions for laptop temperature!

    Good day guys! I am really concern about my laptop temperature. Normal temperature is around 50-60 degrees Celsius, while in gaming around 80-85 but it reached 93 degrees already. I am using a cooling pad and my electric fan is directed towards my laptop especially while gaming. Are these temperatures still healthy? I am using real temp, core temp and Toshiba PC Health Monitor to monitor my processor and GPU temperature.
    My laptop is Toshiba Satellite L745, Intel Core i5-2430, 1Gb nVidia GT GeForece 525M, 8gb ram, 32-bit Windows 7. I just bought this laptop last December 2011. I need opinions guys! Thanks in advance! 

    This is the second post in 2 days dealing with overheating Toshiba Laptops while playing a game.  It doesn't look like the Fans are moving enough air to keep the CPU and GPU cool enough during extensive video operations.
    90 degrees Celcius is way too hot for processors...It doesn't take long to figure out that the Toshiba design is flawed and is very suspect to overheating. Heat will slowly kill the MotherBoard components.
    You probably are NOT suffering from symptom/cause number 1. but double check anyway...the cooling pad may be sucking in MORE dirt/dust than the normal laptop cooling fan and then the dust will collect FASTER at the heatsink cooling fins. You may also be able to increase airflow with solution 2. to solve the overheating problem...
    1. I recommend turning the Laptop Off and unplugging all accessories. Get a good Flash light and look down into the CPU HeatSink Cooling Fins (where the HOT air comes out) You should be able to see inside the area unrestricted. If you see a bunch of Grey Matter, it's more than likely clogged with dust bunny's restricting the airflow.
    Get a can of compressed AIR. Get a vacuum cleaner and hose...no attachments. Turn the laptop upside down on a flat surface so that you have access to both the intake fan vents and the exhaust vents. (facing towards you)
    I have a technique where I hold the vacuum nozzel direcly flat against the FAN IN-Take vent--with the vacuum on--I use the compressed air in 2 second bursts to clean out each of the narrow heat-sink vanes. (Not the open spaces in the plastic case, but each of the metal cooling fins)
    Try to not use too much compressed air as it does have a tiny amount of liquid in it.  You could also wait 30 or so  minutes to let it dry.
    It's a quick fix, but the alternative is to completely taking apart (on most Toshiba's) to get access to the heat sink and CPU.
    2. If you don't see any dust or any more dust after blowing it out and it is still overheating...you could try what I did below...
    I saw a youtube video where a guy rigged up an external 80mm fan with a shroud and duct tape. He powered the 12VDC fan with a battery, but I used one of those Variable Voltage Adapters...set it 12VDC and connected it with Aligator Clips. It didn't look pretty, but the external fan kept the laptop ICE cold.
    "My comments are my own reality" Consider these in addition to other sources. I only know what I know.
    Dan

  • Adding more JButton/JLabel to a frame?

    I have a two frames, one for the meny and one the text. (like a framebuilt website)
    The problem is that the text frame must have diffrent buttons, labels and textareas according to what the user choses in the menu. So it is not only a textarea that is needed to be set .
    Here is the code;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class GUI extends JFrame implements ActionListener
         //Konto
         String konto = "konto";
         //Logo
         String logo = "logo";
         //Meny
         String meny = "meny";
         String login = "login";
         //text
         String text = "text";
         int rattigheter = 0; //0 = kund, 1= personal 2=admin
         //Konto
         private JButton GUIkonto = new JButton (konto);
         //Logo
         private JButton GUIlogo = new JButton (logo);
         //meny
         private JButton GUImeny = new JButton (meny);
         private JButton GUIlogin = new JButton (login);
         //text
         private JLabel GUItext = new JLabel (text);
         private JLabel GUIlogintext = new JLabel ("Skriv in ditt anv�ndarnamn och l�senrod nedan");
         private JLabel GUIlogintext2 = new JLabel ("... Fast eftersom systemet fortfarande testas kan du bara skriva in vilka r�ttigheter du vill ha 1=kund, 2=personal 3=admin");
         private JTextField GUIloginfalt = new JTextField ("", 10);
         private JButton GUIloginknapp = new JButton ("login");
         public GUI()
              Container c = getContentPane();
              c.setLayout(new GridLayout(2, 2));
              JPanel konto = new JPanel(new GridLayout(1, 1));
              konto.add(GUIkonto);
              c.add(GUIkonto);
              JPanel logo = new JPanel(new GridLayout(1, 1));
              logo.add(GUIlogo);
              c.add(GUIlogo);
              JPanel meny = new JPanel(new GridLayout(2, 1));
              meny.add(GUImeny);
              meny.add(GUIlogin);
              c.add(meny);
              System.out.println ("ok " + text);
              if (text.equals("login"))
                   JPanel text = new JPanel(new GridLayout(4, 1));
                   text.add(GUIlogintext);
                   text.add(GUIlogintext2);
                   text.add(GUIloginfalt);
                   text.add(GUIloginknapp);
                   c.add(text);
              else
                   JPanel text = new JPanel(new GridLayout(1, 1));
                   text.add(GUItext);
                   c.add(GUItext);
              setTitle("GUI");
              setVisible(true);
              pack();
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              //------------Lyssanre----------------
              //Konto
              GUIkonto.addActionListener(this);
              //logo
              GUIlogo.addActionListener(this);
              //meny
              GUImeny.addActionListener(this);
              GUIlogin.addActionListener(this);
              System.out.println ("ok, start");
         public static void main (String[] arg)
              GUI a = new GUI();
         public void actionPerformed(ActionEvent e)
              //String konto = GUIkonto.getText();
              //----------------Konto---------------
              if (e.getSource() == GUIkonto)
                   System.out.println ("Konto");
                   GUItext.setText("konto");
              //---------------Logo----------------
              if (e.getSource() == GUIlogo)
                   System.out.println ("logo");
                   GUItext.setText("logo");
              //--------------Meny---------------
              //---------Bl�ddra---------
              if (e.getSource() == GUImeny)
                   System.out.println ("meny");
                   GUImeny.setText("meny2");
              //---------login------------
              if (e.getSource() == GUIlogin)
                   System.out.println ("login");
                   text = "login";
                   System.out.println ("text = " + text);
                   GUItext.setText("login");
                   text = "login";

    Thanks for your help, but I don't think it will work with cardLayout.
    As far as I can understand CardLayout can only show one thing at a time one JButton, or one JLabel or ...
    It must be able to show many components.
                   text.add(GUIlogintext);
                   text.add(GUIlogintext2);
                   text.add(GUIloginfalt);
                   text.add(GUIloginknapp);
                   c.add(text);

  • Hard Drive Disaster - Need opinions on how to get up ASAP

    Hi,
    I have a crisis on my hands. I brought a Virtual machine up about a month ago with Windows Server 2012 R2 and then proceeded to install Exchange 2013 on it. Approximately a week ago I migrated all the mailboxes from Exchange 2007
    to the new machine. After the migration I set Exchange 2013 up with Exchange Online Protection and Azure Rights management and started syncing our Active Directory.
    Now for the bad part: the raid 1 configuration on the server was not syncing the drives and I hadn’t started making backups of the server. The hard drive containing the virtual machine configuration and the virtual hard drive crashed
    without warning 2 days ago. Please don’t beat me up about the backups, I already know how stupid it was to not backup a business critical machine. The hard drive is currently with a data recovery company and they estimate there is a 90% chance of 100% recovery
    of the data. However, I want to be prepare for the worst and would like opinions on what my options are.
    Possible outcomes:
    Everything is recovered and the Virtual Machine fires right up. (I am not very optimistic about this)
    I am able to recover the exchange databases from the failed hard drive.
    Nothing is recovered.
    Preferably option one is what occurs. However, please give me your thoughts on what the best way to get up and running ASAP if I can’t start the machine. I am not an expert but I had the following ideas:
    If I am able to recover the database can I bring a new server up and move the database to it?
    Bring a new server up, create a new database and import the user’s .PST files.
    Since active directory was synced with Microsoft, maybe I can purchase Exchange Hosted and then import the user’s .pst files?
    Any guidance on the above thoughts would be greatly appreciated.
    There a multiple domain controllers in the environment and the old Exchange 2007 server is still up. I believe I still have backups of the Exchange 2007  server with all the mailboxes on it.

    Alright, I am going to post a walk through in case it can help someone else in the future.
    I brought a new Windows 2012 R2 server up and then proceeded to install Exchange 2013 with the recovery switch as BoS pointed out in his posted.
    http://technet.microsoft.com/en-us/library/dd876880(v=exchg.150).aspx
    The installation failed with:
    Disaster recovery setup needs access to the log drive C:\Program files\Microsoft Exchange\v15\mailbox\mailbox database
    xxxxxxxx to continue."
    and
    "Disaster recovery setup needs access to the mailbox database drive C:\Program files\Microsoft Exchange\v15\mailbox\mailbox
    database xxxxxxxx\mailbox database xxxxxxxx.edb to continue."
    To get around the errors, I created the path on the hard drive C:\Program files\Microsoft Exchange\v15\mailbox\mailbox
    database xxxxxxxx and then created a text file with an .edb extension and put it in the folder. On the second attempt to the install it failed with:
    Configuring Microsoft Exchange Server
    Preparing Setup                                          
    COMPLETED
    Stopping Services                                        COMPLETED
    Copying Exchange Files                              COMPLETED
    Language Files                                            COMPLETED
    Restoring Services                                      COMPLETED
    Languages                                                
     COMPLETED
    Hub Transport Server Role                        
    FAILED
    The following error was generated when "$error.Clear();
    Install-ExchangeCertificate -DomainController $RoleDomainController -Services SMTP " was run: "The internal
    transport certificate for the local server was damaged or missing in Active Directory. The problem has been fixed. However, if you have existing Edge Subscriptions, you must subscribe all Edge Transport servers again by using the New-EdgeSubscription cmdlet
    in the Shell.".
    The solution in this post pointed me in the right direction:
    http://social.technet.microsoft.com/Forums/exchange/en-US/d3c443da-6977-43ac-9d20-dc2b0a619e89/exchange-2010-failed-recovery-help?forum=exchangesvravailabilityandisasterrecoverylegacy
    However, instead of
    "MsExchSyncCredential"
    it is “MsExchEdgeSyncCredential”.
    On the third attempt to install the installation failed with:
    A Setup failure previously occurred while installing the HubTransport role.
     Either run Setup again for just this role, or remove the role using Control Panel.
    By following the steps to delete the water mark as shown in example 5 on
    This site I was able to complete the installation of Exchange.
    After Exchange was installed I created a new mailbox database and mounted it. Even though I did not have the old database
    I was able to associate all the email address from it with the new database by running the following in powershell:
    Get-Mailbox –Database “OldDatabaseName” | Set-Mailbox –Database “NewDatabaseName”
    At this point users were able to start logging into the new Exchange server.
    Using the pst files I made from Outlook I was able to import the data back into the new server by following the steps shown
    here:
    http://technet.microsoft.com/en-us/library/ee332351(v=exchg.150).aspx
    As Troy pointed out, the Outlook cache needs to be exported to .pst files before Outlook connects to the new server.
    On a side note, previous to bringing the new server up, I made .pst files from the user’s offline folders in case everything was deleted when the user connected Outlook to the new server; it was not necessary. When
    Outlook (2010 and 2013) connected to the new server a warning window popped up informing the user that their mailbox had been temporarily moved to a new server and gave them the option to use the temporary mailbox or their old data. At any time you should
    be able to select the old data option and then export it to pst.
    I am currently waiting to receive the logs and the Mailbox database back from the data retrieval company.
    As soon as I have copies I am going to import any data that might be missing into the new database.

  • Need a Jbutton object with TWO text labels??

    Hi
    I have a major problem I need to create a JButton object that takes two string as argument
    MyButtonClass(String a, String b);
    I do not have a clue how to do this... the reason I need this is that I have ttf(true type font) file each character refers to an Icon....so the first string argument will be character that refers to appropriate icon and the second argument the label of the button...
    just as the JButton(String text, Icon icon) object...but I do not have a clue how to create an Icon of a character that refers to icon in the ttf file...(I do not think this is possible?)
    I hope some one can give me clue how to this.
    Thanks

    Hi there
    I don't know what you are trying to say maybe you can clarify so that I might be able to help you. As I understand it you have button that must take in to parameters when it is created. These parameters then will say which icon has to be set with font that has been selected.
    This may sound stupid but why don't you create an Icon in (Paint Shop Pro or someting similar) that contains the text with the Icon and then just read the jpg file in as you normally would. Thus just having the switch statement or if statement making the rules for when a specific Icon should be selected.
    I may be wrong but that is what I would do.

  • Need opinions / insights on retina vs non-retina Macbook Pro

    Hi everyone! For weeks now, I have decided that I will be buying the new 13 inch Macbook Pro Retina as a replacement for my very old Acer laptop. I've been a Windows user all my life and this will be the first time that I'll be owning a Mac. So for weeks, I have been researching the pros and cons of the new MBPr versus the non-retina MBR but I have read that there's a huge problem about overheating with the new MBPr, the fans and some also say that the Mail is not working very well and the battery drains easily.
    I still want to buy a MBPr because it's the newest from Apple, I love the resolution and I really like that they took the optical drive out. Does anyone of you know if they already solved the problem in overheating and the fan? This laptop is super expensive and I'll go crazy if I buy this and having to deal with these problems.
    And also, I know the MBPr is the new laptop of Apple but is it that great compared to the ordinary MBP? The ordinary MBP doesn't have problems in overheating, etc... So... basically I just had doubts if I should buy the Retina or the Non-Retina of the Macbook Pro.
    Thank you to anyone who will reply and give their opinions and insights

    The 13" lacks a dedicated graphics processor, it's why it's hot, it's basically a dressed up $400 dual core office store computer with a fancy metal case, too small of a screen and a screen res too high that you really can't tell much from a non-retina anyway.
    The machine is sealed up, you can't upgrade the memory or switchout the storage for something better.
    Many are rather disappointed with the "Pro" label being attached to such a underperforming machine, especially the kids who come here whining they can't play many games on it.
    As a power user and occassional gamer, I absolutely abhor anything below a 15" which does have the muscle with it's quad core goodness and dedicated graphics which it more than twice as fast and lasts twice as long as that stock Intel HD junk.
    Run three operating systems at once if you need too. See the pics here.
    Windows in BootCamp or Virtual Machine?
    In fact I've got myself one of the last 17" MacBook Pro monsters which I treat with extra loving care as it's a collectors item now.
    If your going to treat yourself to a expensive Mac, why short change your experience with a tiny cramped 13" screen that's going to be sitting on your chest half the time?
    I want your first time experience on a Mac to be a good one, pony up for the top of the line 15" and AppleCare, use a external keyboard and mouse to keep the wear and tear off of it.
    I do advise the non-retina anti-glare high res sold in the online store. That baby you can max the RAM out at 16GB, even put two drives in it if you wish with a Superdrive caddy.
    Anti-glares are great for the fact that there is no reflections on the screen, use it nearly anywhere, outside etc. and not have to worry about not seeing the screen. There has been a long thread about the glossy screens bothering people's eyes here.
    You can read the whole glossy vs matte screen debate online.
    A little hidden secret about using Mac's, if you get one of the lower end models, you always feel like you should have gotten one of the better ones. It's because OS X is the same on all the machines regardless of performance, so it tends to feel crapped out quicker on the lower end models and the truth is, dual cores are a has been, quad cores are the new thing.
    Your going to be hooked up to power regardless of what machine you buy to reduce your battery cycles as the more cycles, the less the battery lasts and will either have to be replaced, or the entire machine replaced!
    IMO, getting the 13" is like walking into a Porchse dealer and walking off with one of the scratch and dent models.

  • Macbook pro case splitting. Need opinions please!

    So my laptop case has been splitting near the screen and it also seems to swell at random points. I have never dropped my laptop, I take great care with it as I need it for school. Last time I went to the apple store they told me it was a cosmetic issue and id have to pay around $800.00 to get it fixed. This time I decided to call the national apple line. They told me they think it should be taken care of, and that some one was being dis ingenious in the store (did I get screwed maybe because some one's boss told them to stop giving customers replacements? I have no idea). So Now I am taking this to the apple store tomorrow.. anyone have any similar experiences? What do you think I should argue? I think since I have a 3 year protection plan, I should get at least my entire case replaced, if not a refurbished macbook pro/ or an upgrade. As I was writing this, I can no longer close my macbook pro because than by opening it the bottom part of the screen cover pops out on the right side. Ugh.
    Opinions/help welcome
    [img]http://img210.imageshack.us/img210/729/photo3q.jpg[/img]
    [img]http://img210.imageshack.us/img210/6144/photo2qvh.jpg[/img]
    [img]http://img269.imageshack.us/img269/1679/pic2ipp.jpg[/img]

    Hi Olude,
    I'd present the machine to them, explain exactly what you've stated here in this topic. You do not believe the product to be operating within specification and do not believe that it's condition was caused by accidental damage, rather as a defect in manufacturing and wish to have the repair covered by your Applecare protection.
    The technician will evaluate the product and based upon what they see, and what they're trained to look for in determining coverage eligibility (by Apple) will then present you your options. This is where, you're on your own. No one here will be able to tell you what they'll say, why they'll say or what standards they use to come to their conclusion.
    I personally don't feel comfortable making a stance in either favor, simply because I don't have the machine in front of me, I wasn't with you when the machine began to look like this and I'm no position to comment on Apple's policies and procedures on evaluating coverage on a product. Based on their response (the technician's) you're certainly justified if you want a second opinion, especially if their answer is not to your satisfaction.
    From my experience, I've always been treated with courtesy, respect and appreciation when dealing with members of my local Apple Retail Store. But I've also had them tell me bad news, deny coverage on a product and charge me for repairs when I believed otherwise. Regardless, though, I was always pleased with the way they've handled me and my business. So I hope that the same appreciation is had by you at the conclusion of this experience.

  • Relation between JButton - JLabel

    I want to create an application that if I click a JButton, the JLabel is set with "loading .." text.
    Then, when the process is done, i want the JLabel is set with "done.." text.
    I already create that but the "loading.." text is not appear, just "done.." text.
    Why this is happen ? Is because of action listener can't do that ?
    How to fix this problem ?

    theres a few possibilities, the first that comes to mind is the task being handled during the loading state...
    Is it in a seperate thread, does it execute too quickly to notice change???
    if the "loading process" is occuring in a seperate thread youll have to ensure that code execution blocks until the loading process completes/
    Without actually seeing code though its hard to determine what the problem really is...
    J.Prisco

  • JButton/JLabel/JTextField help

    i created my GUI window frame but im not sure on how to put 2 input fields and one button, and a result JLabel the button is a multiply button which is to multiply the 2 numbers in the two JTextFields
    can anyone help ?

    how bout this
    public class Test extends javax.swing.JFrame implements ActionListener {
         * Comment for <code>serialVersionUID</code>
        private static final long serialVersionUID = 4049077159249130037L;
        private JButton butt;
        private JTextField f1, f2;
         * Auto-generated main method to display this JDialog
         public Test() {
              super();
              initGUI();
         private void initGUI() {
              try {
                    butt = new JButton();
                    f1 = new JTextField();
                    f2 = new JTextField();
                    this.getContentPane().add(butt, BorderLayout.CENTER);
    this.getContentPane().add(f1, BorderLayout.NORTH);
    this.getContentPane().add(f2, BorderLayout.SOUTH);
                    btnShowGUI.setText("Oi");
                    btnShowGUI.setPreferredSize(new java.awt.Dimension(480, 480));
                    btnShowGUI.addActionListener(this);
                    this.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                        System.exit(0);
                   this.setSize(96, 118);
              } catch (Exception e) {
                   e.printStackTrace();
        public void actionPerformed(ActionEvent arg0) {
         if(arg0.getSource().equals(butt){
              System.out.println("f1:"+f1.getText()+" f2:"+f2.getText());
    }gimme my dukes!
    Message was edited by:
    mkoryak

  • JButton/JLabel Help.

    Ok, I was on here earlier this week and recieved wonderful help from you guys on these forums. I honestly learn more from you guys on here than my professor. I am stuck though right now, and I thought I could get out of it but I cant. Here is my problem: I created a window that has a button which opens a header from a file that reads "Rainfall in cm". I dont know how to read a new number and display it everytime I click my button. Here is what my file looks like that I have to read numbers from.
    Rainfall in cm
    7
    23.2
    2.2
    63.2
    1.2
    6.6
    9.7
    2.67
    I only have to read a new number with a decimal point everytime I click a button. I have tried loops with still no success. I am just stuck.
    package cs161a6;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import java.util.*;
    import java.io.FileReader;
    import java.io.FileNotFoundException;
    import java.util.Scanner;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class MainWindow extends JFrame implements ActionListener {
         private static JButton b1;
         private static JLabel L1;
         private static JLabel L2;
         private final String TITLE = "My Window";
         private final int FRAME_X_LOCATION = 100;
         private final int FRAME_Y_LOCATION = 100;
         private final int FRAME_WIDTH  = 400;
         private final int FRAME_HEIGHT = 300;
          * Variables for window
          * Constants for file
         private static final String DIRECTORY = "cs161a6/";
         private static final String FILENAME  = "rainfall.txt";
          * Variables for file
         private static String header;
         private static int number_of_data_points;
         private static Scanner input;
         private static String info;
         public MainWindow() {
              setTitle( TITLE );
              setBounds(FRAME_X_LOCATION, FRAME_Y_LOCATION, FRAME_WIDTH, FRAME_HEIGHT);
              setVisible( true );
              setDefaultCloseOperation( EXIT_ON_CLOSE );
              b1 = new JButton( "Next " + 1 );
              b1.setBounds(240, 110, 150, 50);
              b1.addActionListener( this );
              getContentPane().add( b1 );
          * main
          * @param args
         public static void main(String[] args) throws FileNotFoundException {
              MainWindow window = new MainWindow();
               * Set up and display a window
               * Open a file and read a line from it
              FileReader inFile = new FileReader( "cs161a6/rainfall.txt" );
              input = new Scanner( inFile );
              header = input.nextLine();
              number_of_data_points = input.nextInt();
              info = input.nextLine();
              System.out.println("Opened file: " + FILENAME);
              System.out.println(" description: " + header);
              System.out.println(" number of data points: " + number_of_data_points);
              window.setTitle( "cs161a6/rainfall.txt" );
    public void actionPerformed(ActionEvent evt) {
         System.out.println("Event Recieved");
                  L1 = new JLabel ( header );
                   L1.setBounds (50, 0, 150, 50);
                   getContentPane().add(L1);
                   (( JPanel )getContentPane()).revalidate( );
                   L1.setVisible (true);
    }

    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import java.util.*;
    import java.awt.List;
    import java.io.FileReader;
    import java.io.FileNotFoundException;
    import java.util.Scanner;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class MainWindow extends JFrame implements ActionListener {
         private static JButton b1;
         private static JLabel L1;
         private static JLabel L2;
         private final String TITLE = "My Window";
         private final int FRAME_X_LOCATION = 100;
         private final int FRAME_Y_LOCATION = 100;
         private final int FRAME_WIDTH  = 400;
         private final int FRAME_HEIGHT = 300;
          * Variables for window
          * Constants for file
         private static final String DIRECTORY = "cs161a6/";
         private static final String FILENAME  = "rainfall.txt";
          * Variables for file
         private static String header;
         private static int number_of_data_points;
         private static Scanner input;
         private static String info;
         private List l;
         public MainWindow() {
              setTitle( TITLE );
              setBounds(FRAME_X_LOCATION, FRAME_Y_LOCATION, FRAME_WIDTH, FRAME_HEIGHT);
              setVisible( true );
              setDefaultCloseOperation( EXIT_ON_CLOSE );
              b1 = new JButton( "Next ");
              l = new List();
              b1.setBounds(240, 110, 150, 50);
              b1.addActionListener( this );
              getContentPane().add(l);
              getContentPane().add( b1 );
          * main
          * @param args
         public static void main(String[] args) throws FileNotFoundException {
              MainWindow window = new MainWindow();
               * Set up and display a window
               * Open a file and read a line from it
              FileReader inFile = new FileReader( "rainfall.txt" );
              input = new Scanner( inFile );
              header = input.nextLine();
              System.out.println(" description: " + header);
              window.setTitle( "cs161a6/rainfall.txt" );
    public void actionPerformed(ActionEvent evt) {
         System.out.println("Event Recieved");
              String str=input.nextLine();
              if(str.indexOf(".")!=-1)
                   l.add(str);
    }See the modified code. But I didn't compile it. This is just for an idea.
    Message was edited by:
    harishoty

  • Need Opinions on CS6 Edit Computer Proposal?

    Hello all,
    I am a veteran film/video producer/director.  I am soliciting proposals for a PC Edit Workstation (finally retiring the XP box).  The hardware choices are bewildering to me.  I found a local company, recommended by another editor.  I told them I want a machine between 2 and 3k that will run all programs in CS6 master collection.  This is what they came back with for 3k.  What do you think?  Thanks in advance.  John
    Zero PRO Enterprise Video Editing
    Workstation UP
    Intel Workstation Pedestal Chassis
    Featuring an Intel S1200 series
    Workstation Class ATX Motherboard
    Intel Xeon E3-1230 V2 3.3GHz Quad
    Core Processor w/ HT (8 Processing
    Threads)
    16GB DDR3-1333 Registered ECC Memory
    256GB SSD Boot Hard Drive
    2x 1TB Western Digital Enterprise
    Class Hard Drive in RAID 1
    NVidia Quadro 4000 GPU
    Dual Layer Blu-Ray Burner Optical
    Drive
    Card Reader
    Audigy Sound Card
    USB 3.0
    eSATA
    Firewire 400/800
    Microsoft Windows 7 Professional 64bit
    3 Year Labor, 1 Year Part Warranty
    against manufacturing defects

    Gentlemen,
    I’d like to say that the amount of feedback offered from the community on the Adobe Forums is simply amazing, and we can definitely appreciate everyone’s input and recommendations on putting together a great video editing workstation.   While opinions may vary from vendor to vendor on what hardware spec to use in any given configuration, I’d like to take a second to shed some light on the spec listed above, and what pushes us to make the recommendations we make when configuring anything for a client at GigaParts.
    First- Mr. Gehrke brings up an excellent point concerning a 10-bit monitor for video editing, but keeping in mind that the whole editing path needs to be 10-bit capable- from digital image file all the way to panel depth- it becomes hard for us to recommend a GPU that isn’t.  In regards to a more up to date Quadro, a K5000 (the only Kepler based Quadro card currently released) is nearly 3 times as expensive as the Quadro 4000, and doesn’t really fit into the customer’s budget.  For a little more in-depth description of the 10-bit path we’re referring to, please see the following article:
    http://www.imagescience.com.au/kb/questions/152/10+Bit+Output+Support
    Second- Mr. Gerulaitis and RjL190365 brought up valid concerns about the motherboard included in the spec that I’d like to clarify.  The actual motherboard is an Intel S1200BTLR, which is in-fact an entry level server grade motherboard- something we highly recommend in every spec that may see anything close to 24/7 use.  In our experience over the last fifteen years(and we’ve gained a little being nestled here in Cummings Research Park working with some particularly demanding clients) server and enterprise grade components consistently outlast their consumer-grade counterparts, at the same time providing support options from the manufacturers that simply aren’t available with their consumer-grade lines. Now make no mistake- the concern that the motherboard has a x16 PCIe slot operating at x8 capacity initially seems absolutely valid, but the concerns about it being a “microserver” board optimized for power efficiency and not being suitable for video editing are misplaced concerns that can be clarified with a quick peek at the following links:
    http://www.intel.com/content/www/us/en/motherboards/server-motherboards/server-board-s1200 bt.html
    http://ark.intel.com/products/67494/Intel-Server-Board-S1200BTLR
    As far as having a GPU in a x8 lane vs. a x16 lane, it’s a common misconception that you suffer a HUGE performance loss, when in reality it’s somewhere around 1-2%, and we’ll trade a 1-2% decrease in performance any day of the week if we gain the reliability and support options provided by Intel.  You can find illustrations of this by googling , or testing it out yourself and getting  results similar to what you’ll see here:
    http://www.tomshardware.com/reviews/pcie-geforce-gtx-480-x16-x8-x4,2696-3.html
    http://www.techpowerup.com/reviews/Intel/Ivy_Bridge_PCI-Express_Scaling/23.html
    http://www.tomshardware.com/forum/277646-28-future-proofing
    Third- Mr. Gehrke reiterated his concern that a Quadro 4000 isn’t what he would recommend in a lower cost video editing workstation, and stated he would opt for a GeForce Kepler based GPU.  While we agree that the Kepler GPUs are stout performers, we also have to keep in mind the benefits of using the Quadro- which is in no way a slouch of a performer by any means.  Besides being subjected to a much stricter manufacturing standard than their GeForce counterparts (Which in our minds puts them on par with server boards and enterprise grade hard drives), the NVidia Quadro division also offers a bit more in-depth support from their engineers- including dedicated driver support- which is a big deal when supporting your customer is paramount to anything else. We also like to focus on the unique feature set that becomes available only to customers using the Quadro line- features like the new real-time pro color grading available with Adobe Speedgrade in the CS6 suite.  You can read more about them here:
    http://www.nvidia.com/object/adobe-cs6.html
    Fourth- RjL190365 points out a very important fact concerning memory in conjunction with the E3 series Xeon Processors from Intel, and sadly he is also correct that many system builders make this fatal mistake.  We’d like to clarify that the memory quoted was in-fact unbuffered, not registered, and have re-trained our sales associate on the importance of ‘copy and pasting’ information- it cuts down on typos!  The only memory we authorize for use in our workstations and servers are all Intel validated kits- It insures Intel’s support with their hardware, and that’s a value we pass along to our clients.  We’re also proud to report that it is one of the standards in place that has helped keep our return rate at GigaParts below 3% for nearly 5 years!
    Again, everyone’s opinions and insight into what should go into a great system is very much appreciated, and a valuable learning tool for custom system builders everywhere. Thanks for the input!

  • Need opinions as to which MBP to get

    Hey everyone,
    I'm new here, so forgive me if I break any rules here, and if this thread is in the wrong place I am sorry. I'm a senior in high school right now, and I am looking to get a MBP for college. For school, we are issued a Macbook and we will have to return it at the end of the year. The specs:
    Version 10.6.4
    Processor 2.4 GHz Intel Core 2 Duo
    Memory 2 GB 667 MHz DDR2 SDRAM
    Because we have to return it at the end of the year, I was looking for to buy a MBP. I was looking at the $1799 MBP but I wanted to know if the speeds with be noticeably faster than an IC2D/if this would be the best choice.
    Basically what I would want to use the laptop for would be schoolwork first (writing papers, powerpoints etc),
    then some gaming (Starcraft 2 etc). I also like to record music in Garageband, and edit videos and upload them to YouTube, and when I upload them, it is in bulk; many 10 minute videos in HD.
    Basically, should I get that MBP now based on what I am wanted to use it for, or should I wait and see what they have in store with the faster models/if I even need them.
    If I could get some opinions and ideas, that would be greatly appreciated! Again, sorry if I have broken any rules.

    Not knowing all the details, the entire scenario raises some potential concerns and consideration.
    First the concerns:
    "For school, we are issued a Macbook and we will have to return it at the end of the year." What does that entail? Do you wipe the hard drive and then give it back to the school? Over the course of a semester or year, I would expect that you will be placing some rather confidential info on the system. I would not want to just hand this back to anyone without wiping the drive - the right way.
    Also, then you get to your second year. What happens then - they give you a new one that also has to be turned back in? So what happens to all the files that you may want to keep throughout your education? Guessing maybe a backup would be a good idea - perhaps Time Machine.
    Considerations:
    What are you going to school for? If you are going into engineering, computer science, or actually many degrees that may eventually require more than your initial considerations for use, then a MBP would start to look that much more appealing. Of course there is the issue of what one can afford or what you want to spend. But if you did purchase a higher end MBP then it would likely take you through a 4 year program without a hitch and although it might represent a one-time higher entry cost, you would probably not have to be concerned about getting another one until you graduated, or even after.
    I mentioned the below comment in another post, but it may also apply to your situation:
    If you opted for the 8GB then you might want to consider the 4GB (save $400) and install an 8GB upgrade yourself (seems like the "do it yourself option" is about half, or close to it, so maybe could save $200 in total if that is part of your configuration - enough for the i7 without remorse). Then if you are really savvy you could sell the 4GB off, some places may even offer a rebate if you buy an 8GB RAM upgrade and send in the 4GB. I have just read about hem - goggle at your pleasure. On the flip side of this, I am not sure if upgrading the RAM yourself has any ramifications as far as AppleCare is concerned, or if you even were going to purchase that (which also seems, in general, highly recommend).
    If this is available route, make sure you read the AppleCare terms and conditions and likely a good chat with an AppleCare rep would settle the issue without ado.
    But, I would also qualify this to your situation. You could just get 4GB now and see if you even need the 8GB and then install that as needed.
    And just to throw in another 2nd hand comment. My nephew is going through a 4 year degree. Since I am also researching and interested in getting a MBP (please see my post for own particular questions http://discussions.apple.com/thread.jspa?threadID=2612396&tstart=0), I asked him what the kids at his college were using - which was more popular the Macbook or MBP. Unequivocally, he said that the MBP was the definitive choice. He is not at a "rich kids school" and many of his friends who have MBP are in business majors, which I would make a general statement and assume require less computing power than someone in an engineering or cs discipline, where much of the focus is actually on computers and use, not just using a computer for the standard applications and recreational use.
    Hope this helps or at least gives you more to think about. Good luck in school.

Maybe you are looking for

  • IPhone 3G S has dropped over 83 calls in the last day. 3G is the culprit.

    It started yesterday (Oct 3rd, 2009) as a nuisance, but it grew to make my phone not useable. The symptoms where: iPhone has full bars and the 3G indicator is active. 1: Dial a call phone waits longer than usual to dial, but gets the call through. 2:

  • Multithreaded access to TopLink API

    Hi, If several threads need to access the TopLink API for a given Project, what can be shared and what can't be shared or must be synchronized? Should a different DatabaseSession be used for each thread?

  • F4 in WDA table : The Match Code Button appears 4 lines down

    Hi, I have a problem with the Match code Buttons. In the FAQ of the WebDynproABAP Wiki ( https://wiki.sdn.sap.com/wiki/display/WDABAP/GeneralTechnicalAspects#GeneralTechnicalAspects-2.110), I read something about displaced artefacts in Tables. So I t

  • Search engine preference is google, but when i search it switches to bing

    On my macbook pro which is using mountain lion, by safari search engine preferences is set to google, but when i enter a search term it defaults to bing.  Only noticed this problem after downloading adobe flash player for what it's worth.

  • Developers Toolbox: MX Send Email php script generator

    Hi, I read Foundation PHP for Dreamweaver 8 (I have CS4 Dreamweaver but it’s still a good book). In it, the author claims, that InterAKT has a product called “MX Send Email” in the MX Kollection 3 suite of Dreamweaver extensions, which automates the