Re: not happy with layout of components

I have written the front end of a banking application.
The problem is I am not happy with how the components are positioned.
Any suggestion?
I am using gridlayout(7,2)
6 rows are made up of mainly labels and textfield.
One row is a panel, which has other components.
The problem is there is a large gap between the labels and the next component.
Here is the code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class BankUI extends JFrame {
JLabel jlabel1, jlabel2, jlabel3, jlabel4, jlabel5, jlabel6,
jlabel7, jlabel8, jlabel9, jlabel10;
JCheckBox jcheckbox1, jcheckbox2;
JTextField jtextfield1, jtextfield2, jtextfield3, jtextfield4;
private JComboBox jcombobox1, jcombobox2, jcombobox3;
private String days[] = { "1","2","3","4","5","6","7","8","9",
"10","11","12","13","14","15","16","17",
"18","19","20","21","22","23","24",
"25","26","27","28","29","30","31"};
private String month[] = { "January", "February", "March", "April",
"May", "June", "July", "August", "September",
"October", "November", "December"};
private String year[] = { "1970", "1971","1972","1973","1974","1975","1976",
"1977","1978","1979",
"1980", "1981","1982","1983","1984","1985","1986",
"1987","1988","1989",
"1990", "1991","1992","1993","1994","1995","1996",
"1997","1998","1999",
"2000", "2001", "2002", "2003"};
private JPanel jpanel;
private Container c;
private GridLayout gridlayout;
public BankUI()
super( "Scruple Bank");
gridlayout = new GridLayout(7,2);
c = getContentPane();
c.setLayout(gridlayout);
jlabel1 = new JLabel("Surname:");
jtextfield1 = new JTextField(20);
c.add(jlabel1);
c.add(jtextfield1);
jlabel2 = new JLabel("First name:");
jtextfield2 = new JTextField(20);
c.add(jlabel2);
c.add(jtextfield2);
jlabel3 = new JLabel("Address:");
jtextfield3 = new JTextField(20);
c.add(jlabel3);
c.add(jtextfield3);
jlabel4 = new JLabel();
jtextfield4 = new JTextField(20);
c.add(jlabel4);
c.add(jtextfield4);
jlabel5 = new JLabel("Date of birth:");
c.add(jlabel5);
jpanel = new JPanel();
c.add(jpanel);
jlabel6 = new JLabel("Day");
jcombobox1 = new JComboBox(days);
jcombobox1.setMaximumRowCount(3);
jpanel.add(jlabel6);
jpanel.add(jcombobox1);
jlabel7 = new JLabel("Month");
jcombobox2 = new JComboBox(month);
jcombobox2.setMaximumRowCount(3);
jpanel.add(jlabel7);
jpanel.add(jcombobox2);
jlabel8 = new JLabel("Month");
jcombobox3 = new JComboBox(year);
jcombobox3.setMaximumRowCount(3);
jpanel.add(jlabel8);
jpanel.add(jcombobox3);
jlabel9 = new JLabel();
jcheckbox1 = new JCheckBox("Payment Protection");
c.add(jlabel9);
c.add(jcheckbox1);
jlabel10 = new JLabel();
jcheckbox2 = new JCheckBox("Card Protection");
c.add(jlabel10);
c.add(jcheckbox2);
setSize(750,300);
show();
public static void main(String args[])
BankUI app = new BankUI();
app.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e)
System.exit(0);

I have an open source layout called AttachLayout that a member of this forum gave to me awhile back. It greatly assisted me and you can check it out here:
http://www.compaq.com/java/download/attachlayout/
It's easy and intuitive.
Let me know if you need more assistance or have difficulty getting the classes.

Similar Messages

  • Not happy with moving around keys on the timeline

    I just changed from Final Cut to Premiere CS5.0 and I really like it. Working on a Macbook Pro i5 2.3GHZ, Mac OSX 10.7 But I am not happy with moving around on the timeline. I was used to using the up and down arrows to move to next video edit point, marker point or audio edit point. I tried everything to change it, highlighted the track etc. It only works together with the FN key, which is a bit uncomfortable. And then it definetely is not going to any audio edit points (very annoying!!!) and marker points (have to use Q and W keys). It makes me doubting if continuing with Premiere or not. Its such an esencial and easy to use tool while editing in a normal fast editing rythm. When I change it in the customize keyboard menu, into a Custom keyboard or FCP keyboard, it would ignore my changes on the arrowkeys, although it recognizes any other changes I do. Is it so complicate to change this issue in Premiere to how it is set in FCP? Its such an obvious tool, using the arow keys to move around, cannot beleive that we have to live with such a limitation. Please!!!

    Its such an obvious tool, using the arow keys to move around, cannot beleive that we have to live with such a limitation. Please!!!
    You dont have to live with that at all if you are fixed only to what you have previously done.
    It makes me doubting if continuing with Premiere or not.
    There ya go!

  • I just got iphone 5c and i am not happy with it. It uses to much data and i don't even know how. I can't get the ringtones i want for my contacts.I got it on my free upgrade but i want to take it back and get something else but where i got it they say i c

    I just got iphone 5c and i am not happy with it. It uses to much data and i don't even know how. I can't get the ringtones i want for my contacts.I got it on my free upgrade but i want to take it back and get something else but where i got it they say i can't because i don't have the earbuds and i have serches or them. now i am suck with a phone i don't like at all until my next upgrade. this is very dishearten

    1. If you are this unhappy with that phone, and the lost earbuds is the only thing stopping you from taking it back, why do not just buy some earbuds. That way you can get rid of that phone. It all depend upon how much you want to get rid of that phone.
    2. Yet if you are stuck with that iPhone, here is something might help you to control the data usage. By design, iPhones do turn off WiFi when they go dormant. So if a download is in progress and so forth when the phone goes dormant, it will switch to use cellular data, if this setting is left on. Therefore, from multi-sources I have learned that if you keep your iPhone connected to a power source, then it will stay connected to the available WiFi.

  • How do I change the background colour on notes. I need a darker background due to a visual issue. Apple has now discriminated those with visual issues.  I am so not happy with many of the new changes because of this.

    I am so not happy with the new changes especially when it come to the ability to change background colours, fonts and font sizes/ colours... Does Apple really think that their only audience is the young cool crowd or people who do not have a visual impairment.  Think before you make changes to your software and programs.  You WILL lose more people to androids if you continue this way.
    At least give users the ability to make apps like notes their owned by allowing them to pick the style, theme, background and colour, font size and colour. 
    A very ****** off Apple user who is now looking at Androids.

    Hi Tricia,
    I'm sorry but I don't see an ideal way to do this. Is it the yellow label text, e.g:  "New" against the white background which is causing the difficulty?
    The only way I've found of getting the colors to change in Notes is via Settings>General>Accessibility>Invert Colors but then it looks like something has barfed all over your screen.
    I'd be very, very surprised if Apple do not fix this, firstly because I believe "Accessibility" is a legal matter and secondly because they will not want to cause difficulty for their customers.  We have to remember that this is a major, major overhaul of iOS, it has essentially been taken back to the drawing board and done from scratch again, it may take a little time, but I'm sure they will fix these issues.
    Regards,
    Steve

  • Hi...my last updating software was with 4.2.1 and today I updated new software 4.3.5 and im not happy with more strong vibration ,Can apple consider it  and restore the previous settings of vibration.Thank you

    Hi...my last updating software was with 4.2.1 and today I updated new software 4.3.5 and im not happy with more strong vibration ,Can apple consider it  and restore the previous settings of vibration.Thank you

    Apple isn't here.
    This is a user to user forum.
    Allan

  • Is there a way to get a refund if you're not happy with Logic X?

    I recently bought Logic X and am just not happy with it. Its not for me and I was hoping that maybe I could just return it. Is there a way to go about this?

    No....
    The terms and conditions you agreed to when you bought a license to use Logic Pro X from the App Store do not allow/provide for refunds under such circumstances. Please note the part about you puchasing a license to use Logic Pro X.  This is also why you cannot sell Logic Pro X to another person.... because you didn't buy and own Logic Pro X in the first place... but instead you bought a license to use it... and so you cannot sell it or transfer those rights to another person.
    Now, depending on when you bought your license... you could contact Apple themselves and plead your case...For example, if you bought it by mistake a couple of days ago... and didn't intend to do so...  Apple will normally refund your costs... but based on past examples.. if you 'bought' Logic Pro X more than a week ago, you aren't going to get a refund simply because you are "not happy with it".
    Bear in mind at all times you are not entitled to a refund because of the terms and conditions under which you purchased the license in the first place...  and so Apple don't have to do anything if they choose not to do so.
    Finally, you may also want to read the following.. to understand why posting here is "not contacting Apple directly"
    https://discussions.apple.com/docs/DOC-5671

  • Not happy with Mac book pro retina because of black screen problem.

    I am not happy with Mac book pro retina because of black screen problem. This screen failure appears after one year. I was fan of APPLE now I do no support any apple products. When they expires I will renew them with the other products belong to the other companies.

    You are entitled to 90 day telephone support from Apple. Try contacting them.
    Apple Support Contact
    Apple Support contact - Telephone

  • I have a blackberry and sceen light dont wok and it get hot and turns off and it dont want to down load what can i do it new and i im not happy with it at all but im stuck with it what can i do

    i have a blackberry and im not happy with it at all its gets hot and it burns ur hands and the scern is black and it turns off and dont want to down load i hate is phone and i just got in 3mon ago im now stuck with it

    Hi and Welcome to the Community!
    Given that it's only 3 months old and was brand new, you are covered by warranty. You need to take it to whoever you bought it from as they are the servicer of your warranty.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • HT3702 I need to cancel an application from Sing. I'm not happy with the service. It does attend my needs. I really need to cancel it. And I'm having trouble to do it. Help!!!

    Hi, I had download the application from Sing. Well, I'm not happy with the service.. Plus I'm been charge every week for a service that I'm not using. I'm been trying to surch for  "How to cancel a service", and it seems to be hidding somewhere. Can any one tell me how or what should I do to cancel it?

    There are instructions on this page for managing and stopping auto-renewing subscriptions : http://support.apple.com/kb/HT4098

  • HT1933 Not happy with iTunes app purchase

    Not happy with iTunes app purchase

    By 'not happy' you mean ... ? Whether you might be able to get a refund or credit from iTunes Support depends upon the reason e.g. does the app not work as described, does it abend (have you tried deleting and redownloading it via the Purchased tab in the App Store app on your iPad and contacted the developer ?) ... ?
    If it's not working as described or abends and the developer hasn't replied to you then follow the instructions on the page that you posted from for contacting iTunes Support or use http://reportaproblem.apple.com

  • While deleting sms in a row one one ios 7 hang up and restart. This is happening in my iphone 4. Ps help. Not happy with update, it is extremely slow. Would request apple to provide an option of restoring it back to ios 6

    While deleting sms in a row one one ios 7 hang up and restart. This is happening in my iphone 4. Ps help. Not happy with update, it is extremely slow. Would request apple to provide an option of restoring it back to ios 6

    I'm having same problem with my iPhone 4.  Even after restoring twice.   Simple tasks casue the phone to lock up and restart, which, thanks to iOS 7 takes much longer than with iOS 6. 
    I love my phone, but it is almost unsuable after update.

  • I upgraded to OS X Mavericks. I am not happy with it. How do I delete it? Thanks

    I recently downloaded OS X Maverecks. I am not happy with it. How do I delete it and go back to my original setup? Thanks

    JB6569,
    do you have a Time Machine backup of your MacBook Pro from before you’d installed Mavericks? If so, you can restore from that backup.
    If you don’t have a pre-Mavericks backup, then first I’d recommend purchasing an external drive onto which you can make a Time Machine backup of what you currently have installed. Once you’ve made a backup, or if you’ve decided that you don’t need to preserve your data, you’ll need to boot into Recovery mode by holding down a Command key and the R key as you start up your MacBook Pro. When you see the Mac OS X Utilities menu, select Disk Utility and use it to erase your MacBook Pro’s internal disk. After restarting, OS X Internet Recovery will let you download your MacBook Pro’s originally installed version of OS X (Lion) from Apple’s servers, and will then proceed to install it. Once it’s been installed, you can then restore your data (if any) from the Time Machine backup.

  • I cancel my itune payment reasonly because I'm not happy with the automatic mentho purchase on my credit card. And now I have a problem to update the app

    I'm cancel my  itune pay ment so now they won't let me update all my app. What's happen, I
    Not happy with the automatic payment system with ur apple.
    Tina

    Tinango wrote:
    Not happy with the automatic payment system
    What is wrong with paying for something at time of purcahse?

  • Not happy with this site.

    Not happy with this site. Need containers sent to return unused cartridges to exchange.  This is my third try.

    
    ‎Thank you for using HP Support Forum. I have brought your issue to the appropriate team within HP. They will likely request information from you in order to look up your case details or product serial number. Please look for a private message from an identified HP contact. Additionally, keep in mind not to publicly post ( serial numbers and case details).
    If you are unfamiliar with the Forum's private messaging please click here to learn more.
    Thank you,
    Omar

  • I recently downloaded Mountain Lion and am not happy with it at all.  Is it possible to get rid of it and return to the OS X version that I had previously?

    I recently downloaded Mountain Lion and am not happy with it at all.  Is it possible to get rid of it and return to the OS X version that I had previously?

    rwilkof wrote:
    I recently downloaded Mountain Lion and am not happy with it at all.  Is it possible to get rid of it and return to the OS X version that I had previously?
    Yes, just reinstall from your Time Machine backup you made before updating to Mountain Lion.
    Cheers
    Pete

Maybe you are looking for

  • How is the Adobe AIR runtime distributed?

    The Adobe AIR runtime can be distributed in a number of ways, including but not limited to: Desktop Downloaded and installed from the Adobe website. Installed along with an AIR application as part of a seamless web install. Distributed by third parti

  • Restoring a phone via recovery mode

    Hi If I upgrade a phone using recovery moody as a new phone, can I restore the apps from a previously saved backup in iTunes, or do I have to do a manual build again from the app store?

  • FI&CO Configure doc for ECC 5.0

    Hi Sap Guru's Have anybody provide SAP ECC 5.0 FI&CO Configure doc Thanks venu

  • Broken assets; Events in iPhoto

    I recently completed a project on iDVD 08 which involved slideshows exported from iPhoto. I then tidied up my Events (but did not delete any photos from my iPhoto library), merging and renaming some events. On reloading the DVD project, I have a list

  • Internet banking problems

    I am running Safari 5.1.5 on OS10.6.8 and have problems with internet banking. I can log in and see account but can't get any new transactions to work without an errror message. I rang the bank and they say it is a 'Safari - issue'. Everything works