Wrox Programmer Forums
|
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 May 15th, 2004, 02:03 PM
Registered User
 
Join Date: May 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default help in GUI

Like i have been on ma project in java and making a ATM Machine....i having real troubles in making the interface....as the layouts and panes i am using is really not fitting in ma project....i need help regarding...that how can we set the buttons and textfields etc...at places on the screen which we want...what type of layout shd i use and all....i am designing it all on the full screen mode and using border and as well grid layout....the thing here is that the buttons and textfields etc are pushed towards the corners and all...i want to set them where i want them....plz help as the deadline is on ma head...i would appreciate if anyone mailz me the code regarding this type of material at khfarooq@hotmail.com and post the reply over here... thanxx a lot

 
Old June 14th, 2004, 03:02 AM
Registered User
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by khfarooq
 Like i have been on ma project in java and making a ATM Machine....i having real troubles in making the interface....as the layouts and panes i am using is really not fitting in ma project....i need help regarding...that how can we set the buttons and textfields etc...at places on the screen which we want...what type of layout shd i use and all....i am designing it all on the full screen mode and using border and as well grid layout....the thing here is that the buttons and textfields etc are pushed towards the corners and all...i want to set them where i want them....plz help as the deadline is on ma head...i would appreciate if anyone mailz me the code regarding this type of material at khfarooq@hotmail.com and post the reply over here... thanxx a lot

use layout managers. example:
JButton b1, b2, b3;
JTextField t1;
JPanel top, center, bottom;
String title = "Title";
JLabel label;
Container pane;
b1 = new JButton();
b1.setText("OK");
b2 = new JButton();
b2.setText("Cancel");
b3 = new JButton();
b3.setText("Exit");
t1 = new JTextField(15);
label = new JLabel();
label.setText(title);
top = new JPanel();
top.add(label);
pane = getContentPane();
pane.add(top, BorderLayout.NORTH);
center = new JPanel();
center.add(t1);
pane.add(center, BorderLayout.CENTER);
bottom = new JPanel();
bottom.add(b1);
bottom.add(b2);
bottom.add(b3);
pane.add(bottom, BorderLayout.SOUTH);
 
Old June 17th, 2004, 05:31 PM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

setLayout(null);
after that use setBounds(int x, int y, int width, int height) on components to place them right where you want them with a specified size.

S. Densmore (SCJP)
 
Old July 15th, 2004, 04:33 PM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I recommend you tablelayout at http://www.clearthought.info/software/tablelayout/
a third party layout manager easy and even fun to use
Here you have an straight tutorial
http://www.clearthought.info/softwar...0Printable.doc

 
Old August 15th, 2004, 11:42 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

 
Old August 22nd, 2004, 05:00 AM
Registered User
 
Join Date: Aug 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I recommend you try JFrameBuilder, easy-to-use, special for making Swing GUI, and WYSIWYG.

http://www.mars3000.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Gui program P.Wheat Windows Server 0 February 23rd, 2008 11:06 PM
simple GUI hammie Java GUI 1 April 30th, 2006 06:41 AM
GUI question hlchuah77 C++ Programming 2 October 4th, 2004 07:10 PM
GUI questions hlchuah77 Java GUI 2 August 24th, 2004 09:23 AM
GUI Programming in C# Neeki4444 C# 0 May 21st, 2004 02:36 PM





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