Swing vs. Awt  | Which to choose?

Which one would be a better option to choose?
Thanks in advance.

well, you don't typically mix high-level AWT components with Swing, though. Button or Choice or List being high-level components. All Swing components are java.awt.Containers, of course.
If you can run in a Java 1.2 or higher JVM, then might as well use Swing.

Similar Messages

  • Swing vs AWT (which should I learn?)

    I am writting an mp3 player in Java. I am fairly new to Java as all I know is the programming language; I do not know how to make a GUI. I want to make a cross platform mp3 player that should run on mac, windows and Linux. I also want to use some custom buttons made in Photoshop.
    Should I invest time in learning Swing or AWT?
    Thank you for your help.

    Hello,
    this depends on how far You intend to go with "customizing". Swing leaves a few things to the Operating System e.g. Windows or Linux. My swing apps look different under Linux than they do under Windows, because the Frame in which these apps are are drawn is administered by the OP System. On the other hand if customizing means for example changing the java cup icon upper left or changing the Title of the frame, then You will have no problems. More generally spoken: nearly everything can be done as long as You stay with the possibilities You have (Buttons, TextField, Bars ... have a look at the Swing Platfrom !).

  • Shall i use Swing or AWT for creating a chessboard applet??

    Hi,
    I need to build an applet which should dislpay a chessboard where i should
    be able to move the pieces around, read in a game analysis, etc...
    I am a beginner and i would like some advice on if i should use swing or awt?
    Which one is it easier to work with in terms of dispaying the pieces, moving the pieces and achieving other more challenging functionalities?
    Is it good idea to mix both of them? i.e have a japplet and use a canvas for displaying the board??
    Any advice would be much obliged.

    I used to think AWT
    And someone told me Swing was better..and that all of the Drag-n-Drop stuff doesn't work well with AWT.
    I have to admit that I used AWT up until a project about 3 months ago--I liked it better, but Swing does seem to have more builtins for handling the things you would need to for the Chess Board. Not that you CAN'T do them with AWT, but that they are harder to do with AWT.
    As far as reading in game analysis, etc..that really is independent of Swing/AWT

  • "Object Picker cannot open because no locations from which to choose objects can be found"

    Hi,
    When I try in AD management console in the domain controller to add a new group for a user I get the following error:
    "Object Picker cannot open because no locations from which to choose objects can be found" error message when you try to select objects from an Active Directory domain in Windows 2000
    Our domain controller is a W2000 cluster (two W2000 advanced server machines) and this happens in one of the nodes of the controller while in the other node it Works well (the difference between them is where it fails, has the resources: print,
    file sharing and quorum services). Both nodes of the controller have the remote registry service disabled and in the node where it fails when you start this service it works well but I don`t think this is the reason because in the other node with remote registry
    service disabled it works. Solutions from the following support articles don`t work:
    kb 263231
    kb 284914
    I have checked that the situation is independent of the domain administrator who tries to add the group to the user.
    Can anybody help me? Which is the reason of this different behaviour from one cluster node to another ?
    Thanks.

    Hi Milos,
    Thanks for your answer but I think this is not the case because the problem is not with NTFS and we don' have these problems:
    Users or groups that have Full Control access cannot delegate permissions.
    Users who have Full Control access cannot make permission changes on a DFS share.
    If you give the non-privileged user the right to log on locally and you log on locally to the file server where the error message occurs, you can successfully edit the ACL.
    It only happens with the AD management console. Now, for us it is not posible to upgrade the system.

  • Disk utility: verify selection- which to choose

    When you open disk utility, you see the size/type of HD you have, then underneath usually "Macintosh HD." Assuming this is all you have and you haven't split your disk up, does it matter which you choose in order to repair and verify? Does each location produce different results?

    Hi, powerbook1701.
    Given the situation you described:
    1. One hard drive in or attached the computer.
    2. The hard drive has with only one partition/volume, i.e. you see something similar to the following in the left column of Disk Utility:<pre>233.8 GB Maxtor 7L250S0
    Macintosh HD</pre>Then you can select either the device or the Macintosh HD volume.
    The first line — 233.8 GB Maxtor 7L250S0 — is the device, i.e. the hard drive. The second line, Macintosh HD listed below and indented from the first line, is a volume on that device.
    Note that to run Repair Disk on your normal startup disk, i.e. Macintosh HD, you need to startup from your Tiger Install Disk (or a bootable duplicate of Macintosh HD) and run Disk Utility from there.
    Verify or Repair Permissions only apply to volumes on which Mac OS X is installed. Neither is an available choice for data-only volumes or devices.
    When in doubt, select the volume you want to verify or repair.
    Note that if you have a drive with multiple partitions, e.g.<pre>233.8 GB Maxtor 7L250S0
    Data Volume 1
    Data Volume 2
    Data Volume 3</pre>select the device, and then select either Repair Disk or Verify Disk, all volumes on that device will be repaired or verified in sequence. Again, none of the volumes on that device should be your current startup disk, i.e. the disk from which you started up your Mac.
    You can even select multiple devices by holding the Command Key while making selections. In such a case all volumes on the selected devices will be verified or repaired.
    For example, if I started up from the Tiger Install DVD, launched Disk Utility, selected the two devices shown here:<pre>233.8 GB Maxtor 7L250S0
    Macintosh HD
    233.8 GB Maxtor 7L250S0
    Data Volume 1
    Data Volume 2
    Data Volume 3</pre>and then clicked Repair Disk, all volumes on the two drives would be repaired.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Need  java code to perform refresh button action using swings and awt

    i need java code to perform refresh button action using swings and awt.please help me

    Wait ! Noboby ? OK, I'll do it
    public void onBtnAction ()
        if (!fresh)
            refresh ();
    }Seriously, did you expect anyone to answer such a cryptic question ?

  • Hello I would like to buy Ipad with 3g, but I don't know which company choose... I am living abroad so which one to choose? i need gsm

    Hello I would like to buy Ipad with 3g, but I don't know which company choose... I am living abroad so which one to choose? i need gsm. I am going to buy it then ship it abroad

    Robertafromsp wrote:
    Which iPad is The newest do you know?
    I am puzzled why you could not find that info yourself on the web in a second or two:
    http://en.wikipedia.org/wiki/IPad#Model_comparison

  • Quick practical question: swing vs. awt

    Hi,
    I have an app/applet w/ a fairly simple calculator-type gui. But I want it to run well even on old Pentiums. How much will it matter if I use swing or awt, in terms of performance of the app, ie. user response to gui input? Is it really noticeable?
    Does the system resource usage differ as well even while there is no user input?
    TIA,
    Reggie

    In my experience swing often performs better than awt does, as far as memory and speed...
    Swing can't run in IE without a plugin tho, so consider that before you start switching

  • Guitar & bass plugins with LP8 - several look good, but which to choose?

    I record a lot of guitar & bass parts in a range of styles. Rather then continue to lug hardware around and record parts 'wet', I'm keen on getting a plug-in system for guitar and bass so I can record 'dry' and then experiment with different effects, amps etc in Logic.
    Looking at the various options, NI Guitar Rig 3, IK Multimedia Amplitude (and Ampeg SVX) and the Line6 Gearbox Gold bundle all seem to do what I want.
    But which to choose? I know that preferences will largely be subjective, but I would be grateful to hear from users of any and all of these systems to hear their views.
    Which has the best array of sounds? The best sound quality? Do any of them use vast amounts of processing power and - most importantly - do any of thsm suffer from major latency problems when software monitoring?
    All thoughts will be gratefully received to help me make a considered judgement on which to choose!
    Thanks

    I have all the ones you've mentioned except the Line 6.
    They all can sound equally good (or equally bad, depending on how much you've used real amps!) and seem to react about the same as far as latency is concerned.
    The Logic Gtr amp can get some great sounds, although all of the amp models vary widely in tone and volume, so you really have to tweak. It's the easiest by far on the cpu.
    The Ampeg SVX is killer on bass. Much better than the gtr amp sims are on gtr.
    But with all of the IK Multimedia products I get a terrible buffer burp at the beginning of tracks.
    It's like it won't clear the buffer from the previous pass until you burp it by quickly looping the first few blank bars before the track starts. I get this with T-Racks, Amplitube and SVX.
    Guitar Rig 3 has the most toys to play with.
    Pull up some of the Logic presets and see how they are using the Distortion plugins before the amp.
    Turn off the limiters and gates. You also have a very wide range of colors to choose from with Logic's native plugs.
    If you have to use plugins, then whatever you do, don't go back and forth between real tube amps and pedals. It's much easier that way to convince yourself that you almost have real tone.

  • Is it possible to use events for objects that do not use swing or awt

    Dear Experts
    I want to know if events are possible with plain java objects. A simple class that is capable of firing an event and another simple class that can receive that event. My question is
    1. If it is possible - then what is the approach that needs to be taken and would appreciate an example.
    2. Is Observer Pattern in java going to help?
    To explain further i am doing [Add,Modify,Delete,Traverse] Data tutorial using swing in Net beans. I have a ButtonState Manager class that enables and disables buttons according to a given situation. For example if add is clicked the modify button becomes Save and another becomes Cancel. The other buttons are disabled. What i want is the ButtonStateManager class to do a little further - i.e. if Save is clicked it should report to DBClass that it has to save the current record which was just added. I am foxed how this can be done or what is the right way. Thanks for reading a long message. Appreciate your help.
    Best regards

    Thanks Kayaman
    i guess i am doing something else maybe it is crazy but i need to work further i guess... i cant post the entire code as it is too big but some snippets
    public class DatabaseApplication extends javax.swing.JFrame {
        ButtonStateManager bsm;
        /** Creates new form DatabaseApplication */
        public DatabaseApplication() {
            initComponents();
            // ButtonStateManager has a HUGE constructor that takes all the buttons as argument!
            bsm = new ButtonStateManager(
                    btnAdd,
                    btnModify,
                    btnDelete,
                    btnQuit,
                    btnMoveNext,
                    btnMovePrevious,
                    btnMoveLast,
                    btnMoveFirst );One of the methods in the ButtonStateManager Class is as follows
      private void modifyButtonState()
            btnAdd.setText("Save");
            btnModify.setEnabled(false);
            btnDelete.setText("Cancel");
            btnQuit.setEnabled(false);
            ...Finally the Crazy way i was trying to do ... using EXCEPTIONS!
      void modifyClicked() throws DBAction
            if(btnModify.getText().equalsIgnoreCase("MODIFY"))
                modifyButtonState();
            else
                throw new DBAction("SaveAddedRecord");
        }And Finally how i was Tackling exceptions....
      private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {                                      
          try {
                bsm.addClicked();
            } catch (Exception e1) {
                processDBAction(e1.getMessage());
        private void processDBAction(String msg)
            if(msg.equalsIgnoreCase("SAVEMODIFIEDRECORD"))
                System.err.println(msg);
                bsm.normalButtonState();
            }Edited by: standman on Mar 30, 2011 4:51 PM

  • Running the Swing or AWT code in the UNIX

    I have developed the code to modify the XML attribute values using Java. Those attribute values are accepted from the GUI which i have designed using swings as well as AWT.
    The code is perfectly working in the DOS/Windows environment. The applet/Display is perfectly popping up and accepting the data and it is making the required changes in the XML and creating the new XML.
    But the problem i am facing is,
    I compiled the same code in UNIX and then run the code. But it threw the exception as below. Can anyone help me out for this. What i need to do in order to run that code successfully??.
    bash-3.00$ java GUIAjay
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
    at java.awt.Window.<init>(Window.java:407)
    at java.awt.Frame.<init>(Frame.java:402)
    at javax.swing.JFrame.<init>(JFrame.java:207)
    at GUIAjay.<init>(GUIAjay.java:44)
    at GUIAjay.main(GUIAjay.java:39)
    I tried to set the X11 window server as:
    export DISPLAY=10.5.21.117:0
    But yet the User Interface is not popping up in the UNIX??.
    May be the problem is because GUI is not supported in UNIX.. So please suggest me on this..

    *Don't post general Java questions here*

  • Should I compare SWT to Swing or AWT?

    I am currently doing my dissertation on ways to speed up a Java GUI. Obviously I am comparing the SWT (Eclipse project) to Swing and not really focusing on the AWT (Sun dont seem to be?!). I am interested in looking at how you could create a Swing interface that could compete with the speed of the SWT? I am also looking at the feature set of each and hopefully going to conclude, which is the better widget toolkit, for a highly performant GUI with respect to speed and features?
    Any facts (& opinions :-) would be more than welcome!
    - Simon

    I tried the "panel.paint(Canvas.getGraphics());". However, I still don't have anything printed. My code is as follows.
    JFrame frame = new JFrame("FrameDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setPreferredSize(new Dimension(300, 200));
    jp = new JPanel();
    jp.setPreferredSize(new Dimension(300, 200));
    gpc = MyPlotCanvas.createPlotCanvas();
    Canvas c = gpc.getGraphicsCanvas();
    jp.paint( c.getGraphics() );
    frame.add(jp);
    frame.setSize(600, 500);
    frame.show();

  • Java Swings Vs Flex which is better?

    Hi,
       I do not know whether this is the right place to post this thread. We are planning to replace Java Swings client with Adobe Flex GUI. So I am in the process of analyzing the performances and advantages of Flex over Java Swings.
    So, Can any one kindly let me know whether Flex supports all the features of Java Swings (like components... etc).
    Actually my backend server is also Java and the communication between client and server is based on CORBA.
    So, considering all these constraints please comment on this.
    Regards,
    Purush.

    Both support object-oriented GUI development. The same core ideas apply to both, so the jump for a developer isn't too intense. Perhaps the largest difference is that Flex has XML layout files which is a nice plus (although many abuse the capability of injecting logic into it as well). JavaFX is the Java-world answer to Flex, so you may want to play around with that first since it will be more familiar.

  • Is there an internet browser component in swing or awt?

    Im developing an internet browser using swing, is there any component or that?

    If you just need to open a url you can use
    java.awt.Desktop.getDesktop().open(...);
    should check first if desktop is present and OPEN is supported, otherwise there are some snippet you can google that search/launch a browser based on OS.
    If you need to integrate a browser in your app, as far as I know, SWT makes it easier.
    Bye.

  • When updating Java it asks about 32 bit or 64 bit. How do I know which to choose

    I was using Firefox "Update plug-in" feature. I would select windows 7 option but it wants to know if I want 32 0r 64 bit version. How do I determine which I should select?

    You can look which one is in your computer from My Computer. Right click to my computer icon and choose options. It s written at middle part.

Maybe you are looking for

  • External hard drive wiped  ____is it possible to recover?____

    I have done something really stupid. Whilst attempting to extend the partition for my boot camp with winclone, I inadvertently wiped my external hard drive by creating a partition the whole size of the external hard drive instead of 40g which would h

  • Lightroom web module

    Re "Lightroom Web Module" In the "site info" panel, I type the word "exit" In the "web or mail link" section, I copy and paste the web page address of the page on my site I wish it to be directed to. I preview this with the Lightroom "Preview in Brow

  • Can't add pages to book in iPhoto.

    I'm creating a book in iPhoto and want to add pages to a 33-page Book but it wont let me. I click the icon while on a page and while in an overview but nothing happens.  Help! I'm using iPhoto '11, 9.4.2. Thanks!

  • Can Apple TV display special characters in movie chapter names?

    I have an Apple TV 2.0.1. I have encoded my own movies with descriptive chapter names, imported them into iTunes 7.6.2.9, and synced them to my Apple TV. Does the Apple TV have the ability to display special characters (ó, û, etc.) in movie chapter n

  • GoPro HERO4 Black - Editing 4K on Premiere Pro CC 2014.0.1

    Hello, I'm new to the GoPro and we recently purchased a HERO4 Black.  I'm editing with Premiere Pro CC 2014.0.1 on a MacBook Pro, specs below: 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3 Graphics NVIDIA GeFore GT 750M 2048MB OS X 10.9.4 (13E28) I have