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.
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.
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.
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.
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.
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.