Drawing with Extended JPanel Class

philju <[email protected]> Mon, 4 Aug 2008 09:09:52 -0700 (PDT)
Newsgroups gmane.comp.java.netbeans.user-interface
Message-ID <[email protected]>
Hi all,

I have produced a class that extends JPanel in order to override the paint
method and ensure that an image is painted on the panel following an a call
to the component's repaint() method. The modified paint method includes
conditional code that selects the appropriate colour scheme according to a
configured string option.

My problem relates to the fact that additional methods to change the string
are inaccessible as the object type is fixed as JPanel with NetBeans and not
my extended class, therefore the colour of the graphic is fixed according to
the value passed as a parameter to the constructor.

How do I either produce a dynamic process to achieve this functionality with
an existing JPanel in a way that ensures the configured graphic remains on
it following a repaint() or how do I instantiate the object as my extended
class and include it in the GUI code generated by NetBeans so that the
layout of the form is maintained?

I'm unsure if any code would assist this query, but please let me know if
any is required.

Cheers,
Phil
-- 
View this message in context: http://www.nabble.com/Drawing-with-Extended-JPanel-Class-tp18814353p18814353.html
Sent from the Netbeans - UI mailing list archive at Nabble.com.