Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-01-2010, 05:10 AM   PM User | #1
FlyingRat
New Coder

 
Join Date: Sep 2009
Posts: 50
Thanks: 4
Thanked 4 Times in 4 Posts
FlyingRat is an unknown quantity at this point
Why did my form get bigger?

For some reason, the form I see in my Design view inside Netbeans doesn't look the same as when I run the project. The buttons are much bigger, and the alignment looks way off. It's like it has a different format.

I'm not sure how to explain the issue other than that. I was hoping someone might have that old "oh yeah, here's what happened" solution.

Thanks to you if you do.
FlyingRat is offline   Reply With Quote
Old 01-01-2010, 05:51 AM   PM User | #2
FlyingRat
New Coder

 
Join Date: Sep 2009
Posts: 50
Thanks: 4
Thanked 4 Times in 4 Posts
FlyingRat is an unknown quantity at this point
Here's a picture of design-preview (left) run-time (right):



Any ideas why they'd be different?
FlyingRat is offline   Reply With Quote
Old 01-01-2010, 10:04 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,549
Thanks: 62
Thanked 4,054 Times in 4,023 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Different font sizes? If you don't specify your font sizes using absolute pixels (e.g., font-size: 12px; ) then the browser chooses the size based on other considerations.

And, really, you should *NOT* use absoute font sizes. If you do so, you make your sight inaccessible to, for example, people with vision problems. So long as you use the *recommended* relative font sizes (e.g., x-small, small, medium, etc.) then the user can change the text size via his/her VIEW menu and maybe actually read the stuff that you otherwise made too tiny to see.

One of the BIGGEST mistakes you can make is designing a site down to the very pixel. It may make a pretty site, but it can also make an inaccessible site. I understand that inaccessible sites are technically illegal in some countries, even. (Not, so far, in the USA, but don't be surprised if that changes.)

Anyway, *NEVER* trust the view of your site that you get from some designer program. Always actually look at the site with a browser. And, even better, always look at it with as many browsers as you can. I'd recommend a *minimum* of looking at it with MSIE 7, MSIE 8, FireFox, Chrome, and Safari. You'll surely still find difference between them, but with good overall *flexible* design, the site should look good in all of them.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Old 01-02-2010, 03:09 AM   PM User | #4
FlyingRat
New Coder

 
Join Date: Sep 2009
Posts: 50
Thanks: 4
Thanked 4 Times in 4 Posts
FlyingRat is an unknown quantity at this point
Thanks for the response. This isn't a website, it's a desktop app. The picture is putting the two windows side-by-side. The first window (left) is what I see when I click the preview button of the JFrame Design view withini NetBeans. The second window (right) is what I see when I select the "Run Project" within NetBeans.

The wierd thing is that I had looked like the window on the left for quite a while. I added a couple items to the form and changed some alignments, then it started showing up like on the left. But why wouldn't it show up that way in the preview?

I'm not worried about accessibility in this anyways, because it's solely for myself as a simple admin tool for something. I just think it's strange that it changed like it did. I just started another app to test something out, and it's also showing up differently. I obviously changed something, but I truly can't figure out what I did...It's frustrating me though, because I want to see what the app's going to look like as I'm designing it.

Hmm..
FlyingRat is offline   Reply With Quote
Old 01-02-2010, 04:19 AM   PM User | #5
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
One is metal and the other is windows themed from the looks of it.
Change you're ui theme using the ui manager. Follow this tutorial to make the changes: http://java.sun.com/docs/books/tutor...feel/plaf.html
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
FlyingRat (01-02-2010)
Old 01-02-2010, 07:29 PM   PM User | #6
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,549
Thanks: 62
Thanked 4,054 Times in 4,023 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
I noticed the difference in the "skins" but attributed it to diff between the tool and the browser. DOH on me. Good catch, as usual, Fou-Lu.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Old 01-04-2010, 01:13 AM   PM User | #7
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Quote:
Originally Posted by Old Pedant View Post
I noticed the difference in the "skins" but attributed it to diff between the tool and the browser. DOH on me. Good catch, as usual, Fou-Lu.
Yeah, I wasn't quite certain when I was looking at first myself. I seem to recall that the windows theme was a little... yellower than the metal was. The only part that clued me in was the curvature in the buttons on the windows themed one. It could be the use of the vista that causes that though, my windows theming is limited to the xp apps. I wonder why it is that the preview selects that as its running gui, but doesn't pack it in? Perhaps the OP could post back whether the change was what fixed it.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Old 01-04-2010, 03:00 PM   PM User | #8
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,125
Thanks: 2
Thanked 40 Times in 40 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
In the OP's application, the Look and Feel was most likely not set. When using Netbeans for Windows, the default Look and Feel is WindowsLookAndFeel. However, when you run the application, Java defaults to the Java L&F (CrossPlatformLookAndFeel). Thus, you will get differences between the L&Fs of the IDE's preview and the actual Java app.

Two solutions exist:
-Shane
TheShaner is offline   Reply With Quote
Old 01-05-2010, 01:41 PM   PM User | #9
brad211987
Regular Coder

 
brad211987's Avatar
 
Join Date: Sep 2005
Location: Ohio
Posts: 631
Thanks: 10
Thanked 50 Times in 50 Posts
brad211987 is an unknown quantity at this point
Pulling from old memories, but doesn't the pack() method of the Window class resize your frame to fit its contents? If you set your preferred sizes up carefully for your components, this may help to keep the sizing consistent under different L&F settings.
brad211987 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:18 PM.


Advertisement
Log in to turn off these ads.