Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2571

Re: Repaint not happening

From "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Subject Re: Repaint not happening
Message-ID <78f458757ebcc@uwe> (permalink)
Newsgroups comp.lang.java.gui
References <1191076536.433438.22020@d55g2000hsg.googlegroups.com>
Date 2011-04-27 15:39 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
Chanchal wrote:
..
>It is not that i'm ignoring your advice. 

Have you done the layout tutorial yet?

>..I pretty much appreciate
>that. i know that the porblem here is again setLayout(null). But i'm a
>bit helpless here. It could be a design flaw, but i'm left here with
>five classes which are represented by the five classes in my original
>post. I'm having to develop this UI, but situation here is that i
>cannot go and change the design. 

Yes you can.  If you had done the layout tutorial,
that much should be obvious.

>..Also the added components needs to
>come in the specified places, ..

Which is what layouts do.  The only reason my versions 
of the layouts differed from yours, is that I did not
take much care to place them 'pixel by pixel' exactly
as you had them, that was left as an exercise for you.
'Batteries not included'.

And while we are on 'specified places', I will point out
that null layout/exact positioning GUI's might well fail 
under a different PLAF or Java version, on screens of 
different resolution or size, on different platforms, with 
a different default font size, or.. any number of other 
reasons.

Exact pixel positioning just does not make any sense 
in a language defined to be X-plat - unless you cover 
all of the things mentioned above.  Once your GUI has 
tacked every aspect of that down, you might as well 
have put that logic into a layout manager.

Using the inbuilt layouts might give you a good start 
at understanding how to make a custom layout 
manager.

>..not in a region as defined by the
>BorderLayout or at an available place as decided by the FlowLoayout.

Adjust the borders or insets.  Your comment about 
how the FlowLayout of an earlier example did not meet
your exact requirements is a good indication that
you had not checked the JavaDocs.  They are invaluable
for this stuff, and programmers need to read a lot of
documentation if they expect to be successful.

Asking people on usenet newsgroups to fix the basic
problems with an already very broken null layout, is
no substitute.

>Using GridLayout or GridBagLayout turns out to be too complex. i'm
>forced to use null layout. 

No, you just need to put the effort in to learning how to 
use them.  If you really cannot figure how best to layout 
any particular GUI - try describing it in either a text diagram
(good for usenet, but not the sort of precise definitions
that you seem to want), or an actual (crude or otherwise)
drawing - which cannot be posted to this usenet group,
but can be shown to others via URL.

>..i do not have a choice as far as the design
>of this UI is considered. So all i can do is to find out how i can fit
>things into this may-be-bad design. Again if you are able to give some
>suggestion on how this can be implemented in this given
>scenario,rather than thinking that you are wasting your time, i'd
>appreciate it.

Layouts.

By the way.  You seem to be putting more time and effort 
into your excuses, than you are into doing the layout tutorial, 
or otherwise learning how to use them.  That is not time 
well spent.

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200709/1

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Repaint not happening whe "Chanchal" <chanchal@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
  Re: Repaint not happening "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
  Re: Repaint not happening "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
    Re: Repaint not happening "Chanchal" <chanchal@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
      Re: Repaint not happening "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000

csiph-web