Solved

setCellRenderer

Posted on 2006-11-06
2
300 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 70 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle SQL syntax check  without executing 6 107
ejb message driven bean mdb creation steps 2 35
Running JavaFX on the Raspberry Pi 27 136
Java array 21 86
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

733 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