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


Groups > comp.lang.java.gui > #1201 > unrolled thread

how to execute the code o

Started by"lrantisi" <lrantisi@THRWHITE.remove-dii-this>
First post2011-04-27 15:31 +0000
Last post2011-04-27 15:31 +0000
Articles 5 — 3 participants

Back to article view | Back to comp.lang.java.gui


Contents

  how to execute the code o "lrantisi" <lrantisi@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
    Re: how to execute the co "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
      Re: how to execute the co "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
        Re: how to execute the co "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000
          Re: how to execute the co "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:31 +0000

#1201 — how to execute the code o

From"lrantisi" <lrantisi@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
Subjecthow to execute the code o
Message-ID<1174074266.422409.159550@o5g2000hsb.googlegroups.com>
  To: comp.lang.java.gui
the paintComponenet method is the method we use to put the code that
does the drawing, but how do I execute this code.
How to let the code of the paintComponenet method be executed. ????
Thanks

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

[toc] | [next] | [standalone]


#1202 — Re: how to execute the co

From"Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: how to execute the co
Message-ID<1174078035.627269.51440@n76g2000hsh.googlegroups.com>
In reply to#1201
  To: comp.lang.java.gui
On Mar 16, 12:44 pm, "lrantisi" <lrant...@gmail.com> wrote:
> the paintComponenet method is the method we use to put the code that
> does the drawing, but how do I execute this code.
> How to let the code of the paintComponenet method be executed. ????
> Thanks

When you have created a visible window (JFrame, or JApplet), you can
create a class which extends JComponent and overrides paintComponent.
Once you have done that, you can create an object of your new class,
and "add" it to the content pane of the window you created...

For more details, check out Suns excellent Swing Tutorial trail:
<http://java.sun.com/docs/books/tutorial/uiswing/>

Hope this helps,
Daniel.

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

[toc] | [prev] | [next] | [standalone]


#1205 — Re: how to execute the co

From"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: how to execute the co
Message-ID<1174089883.316319.58520@l77g2000hsb.googlegroups.com>
In reply to#1202
  To: comp.lang.java.gui
On Mar 17, 7:47 am, "Daniel Pitts" <googlegrou...@coloraura.com>
wrote:
> On Mar 16, 12:44 pm, "lrantisi" <lrant...@gmail.com> wrote:
>
> > the paintComponenet method is the method we use to put the code that
> > does the drawing, but how do I execute this code.
> > How to let the code of the paintComponenet method be executed. ????
> > Thanks
>
> When you have created a visible window (JFrame, or JApplet), you can
> create a class which extends JComponent and overrides paintComponent.

JApplet (quite inconsistently) has no paintComponent().
OTOH - I feel 'paint' should neve be overridden in
root level containers.  As soon as the paintComponent()
of a JFrame is customised, management realises they
actually want this as an applet, or in a floating
JOptionPane/JDialog.  If the custom painting is done
in a JPanel, OTOH, the component can be dropped into
whatever other container is needed.

Andrew T.

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

[toc] | [prev] | [next] | [standalone]


#1206 — Re: how to execute the co

From"Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: how to execute the co
Message-ID<1174100610.257143.279670@n76g2000hsh.googlegroups.com>
In reply to#1205
  To: comp.lang.java.gui
On Mar 16, 5:04 pm, "Andrew Thompson" <andrewtho...@gmail.com> wrote:
> On Mar 17, 7:47 am, "Daniel Pitts" <googlegrou...@coloraura.com>
> wrote:
>
> > On Mar 16, 12:44 pm, "lrantisi" <lrant...@gmail.com> wrote:
>
> > > the paintComponenet method is the method we use to put the code that
> > > does the drawing, but how do I execute this code.
> > > How to let the code of the paintComponenet method be executed. ????
> > > Thanks
>
> > When you have created a visible window (JFrame, or JApplet), you can
> > create a class which extends JComponent and overrides paintComponent.
>
> JApplet (quite inconsistently) has no paintComponent().
> OTOH - I feel 'paint' should neve be overridden in
> root level containers.  As soon as the paintComponent()
> of a JFrame is customised, management realises they
> actually want this as an applet, or in a floating
> JOptionPane/JDialog.  If the custom painting is done
> in a JPanel, OTOH, the component can be dropped into
> whatever other container is needed.
>
> Andrew T.

If you noticed, my suggestion to Irantisi was to extend JComponent,
and add that to the JApplet or JFrame. This should work in both
situations.

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

[toc] | [prev] | [next] | [standalone]


#1207 — Re: how to execute the co

From"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Date2011-04-27 15:31 +0000
SubjectRe: how to execute the co
Message-ID<1174102432.347861.152930@e65g2000hsc.googlegroups.com>
In reply to#1206
  To: comp.lang.java.gui
On Mar 17, 2:03 pm, "Daniel Pitts" <googlegrou...@coloraura.com>
wrote:
> On Mar 16, 5:04 pm, "Andrew Thompson" <andrewtho...@gmail.com> wrote:
> > On Mar 17, 7:47 am, "Daniel Pitts" <googlegrou...@coloraura.com>
> > wrote:
...
> > > When you have created a visible window (JFrame, or JApplet), you can
> > > create a class which extends JComponent and overrides paintComponent.
..
> > JApplet (quite inconsistently) has no paintComponent().
> > OTOH - I feel 'paint' should neve be overridden in
> > root level containers.  
...
> If you noticed, my suggestion to Irantisi was to extend JComponent,

Aaah..  now that I read your post more
carefully, I note that not only did you
mention that, but I *quoted* it.

My bad.

> and add that to the JApplet or JFrame. This should work in both
> situations.

Yep.

Andrew T.

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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web