?
Solved

setCellRenderer

Posted on 2006-11-06
2
Medium Priority
?
322 Views
Last Modified: 2011-09-20
Hi,

I have a superclass Maxi that setCellRender(RendererC) for it's List A (a JList). This is the RendererC is declared as a inner class for Maxi

I have extended this superclass Maxi to Class Mini, and wish to retain the functionality of List A, but I would like to change the renderering for List A for Class Mini, so I also declared an inner RendererC for Class Mini, and super.initComponents(), setCellRender for List A to RendererC of Class Mini. But List A continue to retain the outlook of the RendererC in Maxi...

Can I know why this is so, and how can I change it to respond to the class in Mini instead?

0
Comment
Question by:amai
2 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 17882547
After calling super.initComponents() change the cell renderer


list.setCellRenderer(rendererC);
0
 
LVL 92

Accepted Solution

by:
objects earned 280 total points
ID: 17885211
> Can I know why this is so, and how can I change it to respond to the class in Mini instead?

because you are still creating an instance of Maxi's inner class.

add a createRenderer() method that creates your cell renderer and call that from initComponents().
then override createRenderer() in your subclass.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question