🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #238

Re: Swing Problem

#238
From: Paul Furbacher [TeamB]
Date: Sat, 10 Mar 2007 20:03
65 lines
2958 bytes
marcellovin.martinelli@gmail.com wrote:

> On Mar 10, 12:48 am, "Paul Nichols[TeamB]" <p...@comp.net> wrote:
>> marcellovin.martine...@gmail.com wrote:
>>> Hi,
>>> i've created a GUI for my application through Swing components
>>> i've exported as an executable jar and i tried to run my app on others
>>> computers
>>> on a Windows OSx computer i found a problem

"Windows OSx"?!

>>> some frames appear to be empty or black ( -.- ) and if i resize them,
>>> jbutton and text areas ( and all others Swing components) appear.
>>> I've set components position through setBounds() method
>>> i would like to ask if there is a method to set the absolute position
>>> of my swing components ( i thought setBounds() was up to this but -
>>> _- )?
>> What Layout Manager are you using? Please do not tell me XYLayout,
>> because you will always have this problem.
> 
> 
> 
> no layout
> i add components in this way
> jPanel.add(component_name,null);
> 
> and then sets position with
> component_name.setBounds(x,y,width,height);
> 
> that's way changing screen resolution all mess:P

You can say that again.

You need to read up on Swing layout managers and
follow the advice given in any tutorial on the subject.

Google

   +swing +layout +managers +tutorial

See hits:

   http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html

   http://home.cogeco.ca/~ve3ll/jatutorc.htm


Hint: GridBagLayout, though quite difficult, is your friend indeed.


-- 


Paul Furbacher (TeamB)

   Save time, search the archives:
        http://info.borland.com/newsgroups/ngsearch.html

   Is it in Joi Ellis's Faq-O-Matic?
        http://www.visi.com/~gyles19/fom-serve/cache/1.html

   Finally, please send responses to the newsgroup only.
   That means, do not send email directly to me.
   Thank you.
Technical Details
Message-ID: <45f30ee2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <1173199960.373362.108200@n33g2000cwc.googlegroups.com> <45f1f240$1@newsgroups.borland.com> <1173550242.640624.75120@30g2000cwc.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,aa9305e806396af8
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sat, 10 Mar 2007 15:03:23 -0500
From: "Paul Furbacher [TeamB]" <pfurbacher@mac.com>
Organization: Reverse Alchemy, Inc.
User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221)
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing
Subject: Re: Swing Problem
References: <1173199960.373362.108200@n33g2000cwc.googlegroups.com> <45f1f240$1@newsgroups.borland.com> <1173550242.640624.75120@30g2000cwc.googlegroups.com>
In-Reply-To: <1173550242.640624.75120@30g2000cwc.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.142.194.228
Message-ID: <45f30ee2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1173556962 69.142.194.228 (10 Mar 2007 12:02:42 -0800)
Lines: 65
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail