[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

setCellRenderer

Posted on 2006-11-06
2
Medium Priority
?
320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

649 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