Awt  V Swing in applets ???

I've written an applet using Swing but I'm having huge problems trying to get it to run in Internet Explorer (even though it works in the Applet viewer).
Someone suggested rewriting it using awt so that users with older browsers don't have to download a plugin to be able to view it? Is it necessary to download a plugin to view applets with Swing? Is this better to avoid using packages like Swing if possible, in your opinion? Please let me know what you think - I would like as many people as possible to be able to see the applet on their browsers.
Thanks for your time.

It's because of Microsoft and Sun falling out over Java, effectively Microsoft couldn't/wouldn't move beyond 1.1 which was AWT based. At some point in the not too distant future they will remove all Java support so at that point you will be reliant on a plug-in to get to the IE base.
At the moment, if you've already done some AWT work and the GUI is simple, I'd stick with it, otherwise go to Swing and the plug-in. This is of course subjective, others would disagree strongly with me.
Answer provided by Friends of the Water Cooler. Please inform forum admin via the 'Discuss the JDC Web Site' forum that off-topic threads should be supported.

Similar Messages

  • AWT vs Swing vs Applet

    Hi there,
    I'm currently writing a chess game and I'm wondering which would be best to use - AWT, Swing or an applet. I read that using Swing in an applet is not advisable as the classes that would need to be downloaded could be quite large and so take quite a long time. I've been writing it using AWT as I feel that it is fairly simple to change it to Swing or to an applet. What are your opinions on this?
    Many thanks!

    I'm currently writing a chess game and I'm wondering
    which would be best to use - AWT, Swing or an applet.Applets are not separate from AWT or Swing. The Applet class forms part of the AWT package, and JApplets are the Swing equivalent. If you were to use an Applet (or JApplet), you would still have to use AWT/Swing classes, such as Panel, Button etc. for the UI for your program, unless you want a mysterious magical grey box ;P
    I read that using Swing in an applet is not advisable
    as the classes that would need to be downloaded could
    be quite large and so take quite a long time. I don't have a lot of experience using the AWT classes, and use the newer Swing ones. I have heard Swing is easier to use, but many browsers do NOT support Swing classes as standard (particularly Internet Explorer), and require the plug-in, which is a fairly hefty download, especially on a dial-up.
    I've been writing it using AWT as I feel that it is fairly
    simple to change it to Swing or to an applet. What are
    your opinions on this?You say you are using AWT at the minute - are you writing the program as an application? If so, then I'm assuming you have the program running in a Frame, and to use the program as an applet, you would want to change your class from extending Frame to extending Applet. There shouldn't be a lot of change to code when adding components, but you will need to implement Applet methods (such as init()).
    Just note that in order to use the program on a webpage, it must be an applet. If you want to use the program as an applet, seeing as you have already started by using AWT, you might as well stick with it as you would be putting in effort to convert it into Swing only to restrict the potential audience.
    If you want the program to run as an application AND an applet, then the class extending Applet can have a main method, which creates a Frame, before adding a new instance of your applet and calling its init method.

  • How can i connect multiple forms using swings or applets(AWT) & with D-Base

    Hello Friends,
    I am Sreedhar from Hyderabad. working as a java developer in a small organization. I got a challenge to work on java stand alone (desktop) application. Basically our company is based on SCM(Supply Chain Management), I never work before using swings and AWT. now my present challenge is to develope an application on swings and AWT using Net Beans IDE. but i am unble find the code to connect one form to another form, i want to develop similar application like a web application , suppose if i click on OK button it has to connect next form. in the next for it has to take user name and password should allow me to access main form. please help me about this topic, if anybody interested i can send u the screen shots and i can post to ur mail. please help me as soon as possible,

    sreedharkommuru wrote:
    Hello Friends,
    I am Sreedhar from Hyderabad. working as a java developer in a small organization. I got a challenge to work on java stand alone (desktop) application. Basically our company is based on SCM(Supply Chain Management), I never work before using swings and AWT. now my present challenge is to develope an application on swings and AWT using Net Beans IDE. but i am unble find the code to connect one form to another form, i want to develop similar application like a web application , suppose if i click on OK button it has to connect next form. in the next for it has to take user name and password should allow me to access main form. please help me about this topic, if anybody interested i can send u the screen shots and i can post to ur mail. please help me as soon as possible,There is no magic, you need to spend a good amount of time in tutorials, here is a good one to start off with:
    [The Really Big Index|http://java.sun.com/docs/books/tutorial/reallybigindex.html]
    Here are a few tips:
    1 - Do not mix AWT and SWING: it'll just cause you headaches in the long run that you cannot fix without refactoring to properly not mix the 2 together.
    2 - You use JDBC to access the database
    3 - You make accessors/constructors to pass parameters that you need from one form to another.
    Have fun.

  • Swing in Applets

    Hi,
    I can use awt components in my applets no problem, but when ever I put swing components in
    they work in the appletviewer, but not in the browser.
    My code in the applet is fine, all necessary javax libraies included, etc. The code in the HTML file is correct.
    I am using IE 5.5, I have SDK1.3.
    Do I need any additional plugins for using swing? If so has anyone got a link?
    Can anyone help, as no one at my university, can help me.
    thnx in advance.

    Your browser is probably configured to use the Microsoft JVM, which is older and doesn't have the swing classes (probably). To use Sun's java plug-in, make sure you are using the <OBJECT...> tag, not the <APPLET...> tag.

  • Lighter Java GUI than awt and swing?

    I had recently came across a company website (http://www.bambookit.com) where they developed a java gui library without using awt and swing (seems to what they claim). And on top of that it uses xml to generate the gui components (they call widgets) and the whole library size is only 95kb and supports java 1.1.x and above. Their demos on the applets loads super fast, never know/experience that java applets can actually be this quick. But this confuses me, how is it possible to develop a gui alternative to awt with the basic java classes and no dependency on awt? But since the applets are awt based, it means that they must have some dependencies.
    This is an extract from their website (that it seemed they did not use awt)
    "Java has a fundamental flaw in its paint thread that made it very difficult to build extremely large applications without getting severe performance and resource penalties (This affects both AWT and Swing based applications). It�s main repaint queue\thread when assigning paint regions to various controls uses the Graphics objects to �clip� them. On a Sun Solaris machine this does not cause any problems, however on a windows machine each Graphics object consumes a system resource/handle, (a limit of around 16,000 exists on Win 95 and Win 98 machines). Each Bitmap image, each font object, each icon consumes a single system resource or handle. If a full repaint is performed on an application containing 1000 controls, it would consume at LEAST 1000 system resource handles. If the application was updated many times a second, lets say 10 times a second, then that equates to 10,000 handles a second. This is not taking into account labels within controls, the various fonts styles and sizes created, the various images that get loaded. This could easily exceed 20,000 system resource requests a second. Bambookit on the other hand utilizes the clip routines and passes along a SINGLE Graphics objects to all its various controls. This alone is a HUGE savings in system resources and performance."
    Two questions came to my mind:
    1) Is it possible to build applet gui without using awt and swing in java? If so the only way to do is to use JNI calls?
    2) Am I wrong in interpreting www.bambookit.com's message that they are not using awt?
    Any comments about this?
    Regards,
    Stanly

    They use AWT as basis for their drawing-layer, as any other lightweight toolkits too.
    If you just want a very fast & light alternative to swing/awt have a look at www.lwvcl.com !
    I use it for a large applet-applikation that has to be java-1.1 compatible. It was a horor when using AWT which was implemented different over all JVMs available and very slow (although native widgets were used).
    With lwvcl (which has only 150kB!) I can use state of the art applets that work very fast on modern jvms like 1.4, give me the ability to compile my applikation to native code using GCJ (using the swt-prt of the library) or distribute it to old-school 1.1 browser where it also runs quite fine...
    Its free for GPL and very cheap for commercial use.
    lg Clemens

  • From awt to swing = classcastexception ?

    Hi !
    I am trying to move from awt to swing (j2sdk1.4.0_01)
    On recompiling with javac, no visible errors, nor when I try to debug with jdb.
    However when I try to load the class file, the java console tells me that I have a ClassCastException. Going thru the codes, I cannot see where I have type-casted anything wrong !
    Can someone point me in the right direction ?
    THX

    Hi !
    Tried some very simple codes...
    import javax.swing.*;
    public class TreeExample
    public static void main(String args[])
    JFrame frame = new JFrame("The Tree");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(250,250);
    frame.show();
    jdb will run it and display it in an appletviewer
    window, but IE and Netscape will report a
    ClassCastException...
    At this point I think it might be some plug-ins ?The example you gave isn't an applet. Were you trying to run this exact code in a browser or was this just a sample? If you are trying to run this in a browser, it's probably trying to cast your TreeExample class to an Applet, which would explain the ClassCastException.

  • AWT vs SWING and more

    1)Though the components used in awt and swing are similar what is the need for two seperate packages ?
    and
    2)what is the main usage of "getContentPane()" ?
    3)why do we use an appletviewer for executing applets provided the OS is Windows NT ..

    1)Though the components used in awt and swing are
    similar what is the need for two seperate packages ?AWT uses the native (heavyweight) components of the underlying Operating System. Actually a common (and small) subset of the provided components.
    In Swing the components a lightweight, there's no native component behind them, the components are painted by pure java code (sometimes sophisticated components). The swing applications thus can look and feel the same on all platforms.
    2)what is the main usage of "getContentPane()" ?When using swing you shouldn't add lightweight components to the window subclasses, only to the content pane.
    3)why do we use an appletviewer for executing applets
    provided the OS is Windows NT ..Did not understand.
    Kurta

  • How can I create a my own dialog in awt or swings

    How can I create a my own dialog in awt or swings instead of JDialog,Joption.
    if possible some example.
    Thanks in advance
    bhaskar

    hi,
    just use the building blocks of of GUI components and their methods. For examlpe u want to write a Font Dialog box,
    use Frame with lists , thers is classes by which u can pick the all fonts installes on ur system. Do appropriate programming to event handlers . On last in event handler of 'OK' button get the selected item from list and assign to wht u want thats all...........

  • Catching events on Desktop , without using any AWT or Swing components.

    How can I catch events(for eg: mouse clicks) on the Desktop? I do not want to use any AWT or Swing components in my application.
    Also, i want to get events even some other java/non-java application windows are visible on desktop, as long as my application is running.

    Myrequirement is to capture all AWT events, regardless of on which component its being happened.
    I mean I have to capture events outside the current running application (on desktop and any other java/no-java appliation windows also).
    I couldn't find any other forum which discusses about event handling.
    This is part of my app. other end extensively uses awt.

  • Why is HeadlessException explicitly thrown in AWT and swing?

    Hi there,
    I just noticed that HeadlessException is explicitly thrown in some of the constructors in AWT and swing components since J2SE 1.4.
    Given that it's a RuntimeException (unchecked) it doesn't need to be included in the throws clause of the method or constructor.
    There also seems to be inconsistent application of it and inconsistent documentation in the javadoc comments.
    Is this a work in progress or did some refactoring go wrong?

    Most probably IE security settings preventing the js file to be executed. Replied in your other post:
    Unable to get property 'style' of undefined or null reference in sp.ui.dialog.debug.js
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Help Plz! AWT to Swing Conversion

    Hey everyone, I'm new to java and trying to convert this AWT program to Swing, I got no errors, the menu shows but they dont work !! Could somebody please help me? thanks alot!
    Current Under-Construction Code: (no errors)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class zipaint extends JFrame implements ActionListener,      ItemListener,
    MouseListener, MouseMotionListener, WindowListener {
    static final int WIDTH = 800;     // Sketch pad width
    static final int HEIGHT = 600;     // Sketch pad height
    int upperLeftX, upperLeftY;     // Rectangle upper left corner coords.
    int width, height;          // Rectangle size
    int x1, y1, x2, y2, x3, y3, x4, y4; // Point coords.
    boolean fillFlag = false; //default filling option is empty
    boolean eraseFlag = false; //default rubber is off
    String drawColor = new String("black"); //default drawing colour is black
    String drawShape = new String("brush"); //default drawing option is brush
    Image background; //declear image for open option
    private FileDialog selectFile = new FileDialog( this,
    "Select background (.gif .jpg)",
    FileDialog.LOAD );
    // Help
    String helpText = "Draw allows you to sketch different plane shapes over a " +
    "predefined area.\n" + "A shape may be eother filled or in outline, " +
    "and in one of eight different colours.\n\n" + "The position of the " +
    "mouse on the screen is recorded in the bottom left-hand corner of the " +
    "drawing area. The choice of colour and shape are disoplayed also in the " +
    "left-habnd corner of the drawing area.\n\n" + "The size of a shape is " +
    "determined by the mouse being dragged to the final position and " +
    "released. The first click of the mouse will generate a reference dot on " +
    "the screen. This dot will disapear after the mouse button is released.\n\n" +
    "Both the square and the circle only use the distance measured along the " +
    "horizontal axis when determining the size of a shape.\n\n" + "Upon " +
    "selecting erase, press the mouse button, and move the mouse over the " +
    "area to be erased. releasing the mouse button will deactivate erasure.\n\n" +
    "To erase this text area choose clearpad from the TOOLS menu.\n\n";
    // Components
    JTextField color = new JTextField();
    JTextField shape = new JTextField();
    JTextField position = new JTextField();
    CheckboxGroup fillOutline = new CheckboxGroup();
    JTextArea info = new JTextArea(helpText,0,0/*,JTextArea.JSCROLLBARS_VERTICAL_ONLY*/);
    JFrame about = new JFrame("About Zi Paint Shop");
    // Menues
    String[] fileNames = {"Open","Save","Save as","Exit"};
    String[] colorNames = {"black","blue","cyan","gray","green","magenta","red","white","yellow"};
    String[] shapeNames = {"brush","line","square","rectangle","circle","ellipse"};
    String[] toolNames = {"erase","clearpad"};
    String[] helpNames = {"Help","about"};
    public zipaint(String heading) {
    super(heading);
    getContentPane().setBackground(Color.white);
    getContentPane().setLayout(null);
    /* Initialise components */
    initialiseTextFields();
    initializeMenuComponents();
    initializeRadioButtons();
    addWindowListener(this);
    addMouseListener(this);
    addMouseMotionListener(this);
    /* Initialise Text Fields */
    private void initialiseTextFields() {
    // Add text field to show colour of figure
    color.setLocation(5,490);
    color.setSize(80,30);
    color.setBackground(Color.white);
    color.setText(drawColor);
    getContentPane().add(color);
    // Add text field to show shape of figure
    shape.setLocation(5,525);
    shape.setSize(80,30);
    shape.setBackground(Color.white);
    shape.setText(drawShape);
    getContentPane().add(shape);
    // Add text field to show position of mouse
    position.setLocation(5,560);
    position.setSize(80,30);
    position.setBackground(Color.white);
    getContentPane().add(position);
    // Set up text field for help
    info.setLocation(150,250);
    info.setSize(500,100);
    info.setBackground(Color.white);
    info.setEditable(false);
    private void initializeMenuComponents() {
    // Create menu bar
    JMenuBar bar = new JMenuBar();
    // Add colurs menu
    JMenu files = new JMenu("Files");
    for(int index=0;index < fileNames.length;index++)
    files.add(fileNames[index]);
    bar.add(files);
    files.addActionListener(this);
    // Add colurs menu
    JMenu colors = new JMenu("COLORS");
    for(int index=0;index < colorNames.length;index++)
    colors.add(colorNames[index]);
    bar.add(colors);
    colors.addActionListener(this);
    // Add shapes menu
    JMenu shapes = new JMenu("SHAPES");
    for(int index=0;index < shapeNames.length;index++)
    shapes.add(shapeNames[index]);
    bar.add(shapes);
    shapes.addActionListener(this);
    // Add tools menu
    JMenu tools = new JMenu("TOOLS");
    for(int index=0;index < toolNames.length;index++)
    tools.add(toolNames[index]);
    bar.add(tools);
    tools.addActionListener(this);
    // Add help menu
    JMenu help = new JMenu("HELP");
    for(int index=0;index < helpNames.length;index++)
    help.add(helpNames[index]);
    bar.add(help);
    help.addActionListener(this);
    // Set up menu bar
    setJMenuBar(bar);
    /* Initilalise Radio Buttons */
    private void initializeRadioButtons() {
    // Define checkbox
    Checkbox fill = new Checkbox("fill",fillOutline,false);
    Checkbox outline = new Checkbox("outline",fillOutline,true);
    // Fill buttom
    fill.setLocation(5,455);
    fill.setSize(80,30);
    getContentPane().add(fill);
    fill.addItemListener(this);
    // Outline button
    outline.setLocation(5,420);
    outline.setSize(80,30);
    getContentPane().add(outline);
    outline.addItemListener(this);
    /* Action performed. Detects which item has been selected from a menu */
    public void actionPerformed(ActionEvent e) {
    Graphics g = getGraphics();
    String source = e.getActionCommand();
    // Identify chosen colour if any
    for (int index=0;index < colorNames.length;index++) {
    if (source.equals(colorNames[index])) {
    drawColor = colorNames[index];
    color.setText(drawColor);
    return;
    // Identify chosen shape if any
    for (int index=0;index < shapeNames.length;index++) {
    if (source.equals(shapeNames[index])) {
    drawShape = shapeNames[index];
    shape.setText(drawShape);
    return;
    // Identify chosen tools if any
    if (source.equals("erase")) {
    eraseFlag= true;
    return;
    else {
    if (source.equals("clearpad")) {
    remove(info);
    g.clearRect(0,0,800,600);
    return;
    if (source.equals("Open")) {
    selectFile.setVisible( true );
    if( selectFile.getFile() != null )
    String fileLocation = selectFile.getDirectory() + selectFile.getFile();
    background = Toolkit.getDefaultToolkit().getImage(fileLocation);
    paint(getGraphics());
    if (source.equals("Exit")) {
    System.exit( 0 );
    // Identify chosen help
    if (source.equals("Help")) {
    getContentPane().add(info);
    return;
    if (source.equals("about")) {
    displayAboutWindow(about);
    return;
    public void paint(Graphics g)
    super.paint(g);
    if(background != null)
    Graphics gc = getGraphics();
    gc.drawImage( background, 0, 0, this.getWidth(), this.getHeight(), this);
    /* Dispaly About Window: Shows iformation aboutb Draw programme in
    separate window */
    private void displayAboutWindow(JFrame about) {
    about.setLocation(300,300);
    about.setSize(350,160);
    about.setBackground(Color.cyan);
    about.setFont(new Font("Serif",Font.ITALIC,14));
    about.setLayout(new FlowLayout(FlowLayout.LEFT));
    about.add(new Label("Author: Zi Feng Yao"));
    about.add(new Label("Title: Zi Paint Shop"));
    about.add(new Label("Version: 1.0"));
    about.setVisible(true);
    about.addWindowListener(this);
    // ----------------------- ITEM LISTENERS -------------------
    /* Item state changed: detect radio button presses. */
    public void itemStateChanged(ItemEvent event) {
    if (event.getItem() == "fill") fillFlag=true;
    else if (event.getItem() == "outline") fillFlag=false;
    // ---------------------- MOUSE LISTENERS -------------------
    /* Blank mouse listener methods */
    public void mouseClicked(MouseEvent event) {}
    public void mouseEntered(MouseEvent event) {}
    public void mouseExited(MouseEvent event) {}
    /* Mouse pressed: Get start coordinates */
    public void mousePressed(MouseEvent event) {
    // Cannot draw if erase flag switched on.
    if (eraseFlag) return;
    // Else set parameters to 0 and proceed
    upperLeftX=0;
    upperLeftY=0;
    width=0;
    height=0;
    x1=event.getX();
    y1=event.getY();
    x3=event.getX();
    y3=event.getY();
    Graphics g = getGraphics();
    displayMouseCoordinates(x1,y1);
    public void mouseReleased(MouseEvent event) {
    Graphics g = getGraphics();
    // Get and display mouse coordinates
    x2=event.getX();
    y2=event.getY();
    displayMouseCoordinates(x2,y2);
    // If erase flag set to true reset to false
    if (eraseFlag) {
    eraseFlag = false;
    return;
    // Else draw shape
    selectColor(g);
    if (drawShape.equals("line")) g.drawLine(x1,y1,x2,y2);
    else if (drawShape.equals("brush"));
    else drawClosedShape(drawShape,g);
    /* Display Mouse Coordinates */
    private void displayMouseCoordinates(int x, int y) {
    position.setText("[" + String.valueOf(x) + "," + String.valueOf(y) + "]");
    /* Select colour */
    private void selectColor(Graphics g) {
    for (int index=0;index < colorNames.length;index++) {
    if (drawColor.equals(colorNames[index])) {
    switch(index) {
    case 0: g.setColor(Color.black);break;
    case 1: g.setColor(Color.blue);break;
    case 2: g.setColor(Color.cyan);break;
    case 3: g.setColor(Color.gray);break;
    case 4: g.setColor(Color.green);break;
    case 5: g.setColor(Color.magenta);break;
    case 6: g.setColor(Color.red);break;
    case 7: g.setColor(Color.white);break;
    default: g.setColor(Color.yellow);
    /* Draw closed shape */
    private void drawClosedShape(String shape,Graphics g) {
    // Calculate correct parameters for shape
    upperLeftX = Math.min(x1,x2);
    upperLeftY = Math.min(y1,y2);
    width = Math.abs(x1-x2);
    height = Math.abs(y1-y2);
    // Draw appropriate shape
    if (shape.equals("square")) {
    if (fillFlag) g.fillRect(upperLeftX,upperLeftY,width,width);
    else g.drawRect(upperLeftX,upperLeftY,width,width);
    else {
    if (shape.equals("rectangle")) {
    if (fillFlag) g.fillRect(upperLeftX,upperLeftY,width,height);
    else g.drawRect(upperLeftX,upperLeftY,width,height);
    else {
    if (shape.equals("circle")) {
    if (fillFlag) g.fillOval(upperLeftX,upperLeftY,width,width);
    else g.drawOval(upperLeftX,upperLeftY,width,width);
    else {
    if (fillFlag) g.fillOval(upperLeftX,upperLeftY,width,height);
    else g.drawOval(upperLeftX,upperLeftY,width,height);
    /* Mouse moved */
    public void mouseMoved(MouseEvent event) {
    displayMouseCoordinates(event.getX(),event.getY());
    /* Mouse dragged */
    public void mouseDragged(MouseEvent event) {
    Graphics g = getGraphics();
    x2=event.getX();
    y2=event.getY();
    x4=event.getX();
    y4=event.getY();
    displayMouseCoordinates(x1,y1);
    if (eraseFlag) g.clearRect(x2,y2,10,10);
    else {
    selectColor(g);
    if(drawShape.equals("brush")) g.drawLine(x3,y3,x4,y4);
    x3 = x4;
    y3 = y4;
    // ---------------------- WINDOW LISTENERS -------------------
    /* Blank methods for window listener */
    public void windowClosed(WindowEvent event) {}
    public void windowDeiconified(WindowEvent event) {}
    public void windowIconified(WindowEvent event) {}
    public void windowActivated(WindowEvent event) {}
    public void windowDeactivated(WindowEvent event) {}
    public void windowOpened(WindowEvent event) {}
    /* Window Closing */
    public void windowClosing(WindowEvent event) {
    if (event.getWindow() == about) {
    about.dispose();
    return;
    else System.exit(0);
    Code End
    Thanks again!
    class ziapp {
    /* Main method */
    public static void main(String[] args) {
    zipaint screen = new zipaint("Zi Paint Shop");
    screen.setSize(zipaint.WIDTH,zipaint.HEIGHT);
    screen.setVisible(true);

    First of all use the [url http://forum.java.sun.com/features.jsp#Formatting]Formatting Tags when posting code to the forum. I'm sure you don't code with every line left justified so we don't want to read unformatted code either.
    Hey everyone, I'm new to java and trying to convert this AWT program to SwingInstead of converting the whole program, start with something small, understand how it works and then convert a different part of the program. You can start by reading this section from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html]How to Use Menus.
    From a quick glance of your code it looks like you are not adding an ActionListener to your JMenuItems. You are adding them to the JMenu.
    Other observations:
    1) Don't mix AWT with Swing components. You are still using CheckBox
    2) Don't override paint(). When using Swing you should override paintComponent();
    3) Use LayoutManagers. Using a null layout does not allow for easy maintenance of the gui. Right now you are using 800 x 600 as your screen size. Most people are probably using at least 1024 x 768 screen sizes. When using LayoutManagers you would suggest component sizes by using setPreferredSize(), not setSize().

  • Learn AWT before Swing?

    I have zero practical knowledge of Java GUI programming.
    Swing sits on top of AWT. Swing is easier than AWT. Yet, so as to understand Swing, and to be able to do things Swing might not be able to do, I am inclined to first only use AWT. Build a base on which to learn Swing.
    A counter argument would be, in my opinion, C vs. C++. While C++ sits on top of C, I don't see any benefit to learning pure C before C++. Further, I don't want things to be too difficult before making them easier regarding GUIs.
    Should the progression be: AWT then Swing? Swing then AWT then Swing? just Swing, and learn AWT if ever needed?

    I agree with the others, just learn swing and the parts of awt you need will just come along.
    But I want to add that using a GUI generator to create swing for you is very tempting, especially at first, but is the worst thing you can do to handicap yourself. I know you didn't mention them, so this is sort of comming from left field, but just saying avoid them until you really know swing.
    Also, how can you not see a benefit in learning C before C++? True C++ (even if not always practiced) is object oriented whereas true C is procedural. While OO programming is generally better, it is beneficial to understand procedural programming as well, and knowing both will only make you better as a programmer. But even more important is by never learning true C one never has a chance to learn just how powerful pointers are. Pointers are difficult to get your head around, but they are extreemly usefull, if you are one of the few rare people who can use them correctly and unlock their true power.
    Just Saying.
    JSG

  • Difference between awt ang Swing Interview Question n other Question

    hi every one i use to think that i know java atlest so much that i can crack a lolcal comp interview but ........................
    i ansered few Question but was speachlees when was asked few of this i do not remember all of them
    1] difference between awt and swing.
    2]System.out.println();
    System is a class out is a variable so who come a variable calling a method.
    3]are constractor inherateed in java.

    1] difference between awt and swing.AWT is based on an abstraction of platform-specific, heavy-weight components. Swing is written entirely in java.
    >
    2]System.out.println();
    System is a class out is a variable so who come a
    variable calling a method.Do you mean how come?
    In that case, the answer is simple: Because out is a variable, it can be redirected/compared against, etc much easier
    3]are constractor inherateed in java.Kind of a trick question, as the answer is yes and no. Constructors are not inherited, but every constructor in the subclass must call one and exactly one constructor of the superclass

  • Database Connection to AWT and Swings

    How do we provide database connection to AWT and swing components?
    Is their any possibility to create database connection?
    Thanks in advance

    Just create an independent DAO class which does all the database/JDBC tasks.
    Then use this DAO class as you use every other class in your AWT/Swing application.

  • Running the Swing based applet in html

    Hi
    I am getting problem while runing a swing based applet in html. If i am using eclips and run my file as java applet it is working fine.
    For testing purpose, my html and all jars are in the same folder where my applet class is reside.
    Also i am not getting any error in html..
    Please help

    http://java.sun.com/docs/books/tutorial/deployment/applet/index.html

Maybe you are looking for

  • How do I sync 2 devices to the same data?

    I have a life drive and my wife has a treo 650. We both wish to synchronize with the same data on our pc.How do we do that? Post relates to: LifeDrive Message Edited by thetreoguy on 04-09-2009 05:54 PM

  • Dvd to ipod converter

    im looking for a good dvd to ipod video converter,but free also anybody have any good websites that will do the job really good and really fast please tell,im dying to see my dvds in my ipod.THANK YOU

  • Why different result for the same jsp file run at oc4j902 and oc4j903?

    In a jsp file, It use class in "java.util" package, It is not import "java.util.*". The jsp file run at oc4j 902: It run correctly The jsp file run at oc4j 903: appear Compile error. the error is: "OracleJSP: oracle.jsp.provider.JspCompileException:

  • Syntax of DBCA Template files (.dbt)

    Hi! I am looking for documentation on the content / syntax of DBCA template (.dbt) files. I have searched the 10G documentation and MetaLink without success. Any help or hints is appreciated. I am especially interested in setting up my own variables

  • Setting userid parameter for srw.run_report

    Hi, I'm using the srw package to run a report from a pl/sql procedure. All the documentation I can find regarding the SRW package says to set the userid parameter to 'userid/password@database' e.g. srw.add_parameter(lv_srw_plist,'USERID','userid/pass