Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2004, 10:48 PM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default who can do this!!!!!!!!

friends, who can write a java program that that creates a GUI that looks like the one shown below (click the link):

http://abuali2u.jeeran.com/mage.jpg

 
Old July 26th, 2004, 09:49 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

OK, this is probably not what you actually want, but it's useful for ppl who want to make splash screens and stuff...

Code:
import java.awt.*;
import java.io.*;
import java.net.*;
import javax.swing.*;

/**
 *  Description of the Class
 *
 * @author     Charlie
 * @created    26 July 2004
 */
public class fancyGUI extends JFrame {
    private  ImageIcon  spl;
    private  JLabel     l    = new JLabel();

    public fancyGUI() {
        //setSize(500, 300);
        Dimension  screenSize  = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - 500) / 2, (screenSize.height - 300) / 2);
        setUndecorated(true);
        try {
            spl = new ImageIcon(new URL("http://abuali2u.jeeran.com/mage.jpg"));
        } catch (Exception x) {
            x.printStackTrace();
        }
        //l.setSize(500, 300);
        l.setIcon(spl);
        getContentPane().add(l);
        pack();
        setVisible(true);
    }

    public static void main(String argv[]) {
        new fancyGUI();
    }
}
--
Don't Stand on your head - you'll get footprints in your hair. http://charlieharvey.com
 
Old August 15th, 2004, 09:41 PM
Registered User
 
Join Date: Aug 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This will build that layout as a top level form. Your example appaers to be an MDI. Let me know if you want is as MDI.

Code:
/*
 * MyDemo.java
 * Created on August 15, 2004, 10:30 PM
 */

/**
 *
 * @author  alexthenerd
 * [email protected]
 */
public class MyDemo extends javax.swing.JFrame {

    /** Creates new form MyDemo */
    public MyDemo() {
        initComponents();
        this.setSize(300, 200);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     */
    private void initComponents() {
        jLabel1 = new javax.swing.JLabel();

        getContentPane().setLayout(new java.awt.GridLayout());

        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
            }
        });

        jLabel1.setText("My Demo");
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setFont(new java.awt.Font("Dialog", 3, 18));
        getContentPane().add(jLabel1);

        pack();
    }

    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
        System.exit(0);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        new MyDemo().show();
    }


    // Variables declaration - do not modify
    private javax.swing.JLabel jLabel1;
    // End of variables declaration

}
 
Old August 15th, 2004, 11:39 PM
Registered User
 
Join Date: Aug 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Look, there are numerous tools out there ranging from free to affordable to expensive to make Java GUI painless. Once used you can study the generated code to see how it's done:

Free
-----
Netbeans - A full featured, cross platform, Open Source Java IDE w/ a nice GUI designer including Gridbag Layout. Very mature robust product. Written in Java it requires a fast computer to appreciate (600mhz +, 128MB RAM +, 3D graphics card)
http://www.netbeans.org

Borland JBuilder (Foundation Edition) - Powerful, fast, full featured Java IDE and GUI Designer.
http://www.borland.com/jbuilder/foundation/index.html

Elcipse - Full featured Java IDE, but no built in GUI designer. Not as mature as Netbeans or JBuilder, but improving in leaps and bounds. Faster than Netbeans, but slower than JBuilder. GUI designers for eclipse can be purchased from 3rd parties.
http://www.eclipse.org/

Affordable
----------
Swing designer - $199.00 a Java GUI editor plug-in for Eclipse. Really sweet GUI layout tool capable of rapid development of complex GUIs in Swing or Eclipse's SWT and the code it generates is professionally formatted, readable, and easy to maintain.
http://www.instantiations.com/swing-designer/


Expensive
---------
Borland JBuilder (Developer Edition) - $499 Top of the line Java IDE, GUI Designer, and Rapid Database Developer.
http://www.borland.com/jbuilder/developer/index.html

BX for Java - $998 a complete stand alone visual development tool for pure Java applications. Includes a database designer module that makes Java widgets "data-aware" by mapping them to database fields.
http://www.ics.com/products/bxjava/

Hope this helps,

Alex










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.