Custom combobox renderer (interactive tooltip) on Vista
I'm trying to add following functionality to my code:
http://www.java2s.com/Code/Java/Swing-Components/ToolTipComboBoxExample.htm
but I've found there is rendering problem on Vista. I don't know why, but following addition to original code
if (-1 < index) {
list.setToolTipText(jtUtil.getToolTip(value.toString()));
causes wrong rendering of 'selected item area' of combobox. There is white background instead of gradient. Is there any other Vista user who can confirm such behaviour or it is problem on my computer?
Is there another way how to ensure the same functionality without changes to renderer, for example addition any listener to javax.swing.plaf.basic.BasicComboPopup class? Or is there any easy way how to make own renderer without such fatal results? Thanks in advance for any tips.
Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
I don't use Vista, but I would guess the problem is because your code is overriding the background property of the renderer. All you want to do is set the tooltip text so there is no need to change the default rendering of the renderer. Maybe something like the following will work:
class MyComboBoxRenderer extends BasicComboBoxRenderer {
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
Component c = super.getListCellRendererComponent(
list, value, index, isSelected, cellHasFocus);
if (-1 < index)
list.setToolTipText(tooltips[index]);
return c;
}
Similar Messages
-
Adding custom combobox to my scene7 tab in contentfinder
I am trying to add custom combobox by extending the OOB scene7 contentfinder in CQ. But for some reason, I am not seeing my combo box (id and selected value) getting passed in the request header as query parameter. Following is the js code I am using, has anyone worked on such a customization?
=================================================
CQ.Ext.ns("MyClientlib");
MyClientlib.ContentFinder = {
TAB_S7_BROWSE : "cfTab-S7Browse",
S7_QUERY_BOX: "cfTab-S7Browse-Tree",
CONTENT_FINDER_TAB: 'contentfindertab',
S7_RESULTS_BOX: "cfTab-S7Browse-resultBox",
addPageFilters: function(){
var tab = CQ.Ext.getCmp(this.TAB_S7_BROWSE);
var queryBox = CQ.Ext.getCmp(this.S7_QUERY_BOX);
queryBox.add({
"xtype": "label",
"text": "Select Path",
"cls": "x-form-field x-form-item-label"
var metaCombo = new CQ.Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new CQ.Ext.data.ArrayStore({
id: "cfTab-s7Browse-metaDataStore",
fields: [
'myId',
'displayText'
data: [[1, 'Name'], [2, 'Keywords'], [3, 'Description']]
valueField: 'myId',
displayField: 'displayText',
listners: {
select: function (combo, record, index) {
var store = CQ.Ext.getCmp(this.S7_RESULTS_BOX).items.get(0).store;
store.setBaseParam("mFilter",CQ.Ext.getCmp(" cfTab-s7Browse-metaDataStore").getValue());
// CQ.S7.setSearchQualifiers(store);
store.reload();
queryBox.add(metaCombo);
var cfTab = queryBox.findParentByType(this.CONTENT_FINDER_TAB);
queryBox.add(new CQ.Ext.Panel({
border: false,
height: 40,
items: [{
xtype: 'panel',
border: false,
style: "margin:10px 0 0 0",
layout: {
type: 'hbox'
items: [{
xtype: "button",
text: "Search",
width: 60,
tooltip: 'Search',
handler: function (button) {
var params = cfTab.getParams(cfTab);
cfTab.loadStore(params);
baseCls: "non-existent",
html:"<span style='margin-left: 10px;'></span>"
xtype: "button",
text: "Clear",
width: 60,
tooltip: 'Clear the filters',
handler: function (button) {
$.each(cfTab.fields, function(key, field){
field[0].setValue("");
queryBox.setHeight(230);
queryBox.doLayout();
var form = cfTab.findByType("form")[0];
cfTab.fields = CQ.Util.findFormFields(form);
changeResultsStore: function(){
var queryBox = CQ.Ext.getCmp(this.S7_RESULTS_BOX);
var resultsView = queryBox.ownerCt.findByType("dataview");
var rvStore = resultsView[0].store;
rvStore.proxy = new CQ.Ext.data.HttpProxy({
url: CQ.S7.getSelectedConfigPath() + "/jcr:content.search.json",
method: 'GET'
(function(){
var INTERVAL = setInterval(function(){
var c = MyClientlib.ContentFinder;
var tabPanel = CQ.Ext.getCmp(CQ.wcm.ContentFinder.TABPANEL_ID);
if(tabPanel){
clearInterval(INTERVAL);
c.addPageFilters();
//CQ.Ext.Msg.alert('meta','CQ.Ext.getCmp("cfTab-s7Browse-metaDataStore").getValue()');
c.changeResultsStore();
}, 250);
=================================================Hi Aanchal,
i have posted exactly the same problem a few months ago, and no one answered me.
I couldn't find any documentation on how to add custom GP parameters in the universal worklist, in the examples on customizing the UWL XML they always refer to parameters from the r/3 webflow, never GP.
I really can't believe that nobody ever tried to do this and faced this problem!
Please let me know if you find something..
Regards,
Marco. -
I have got a JList.
And I am going to create my custom cell renderer which can show a label and a pic inline.
How can I do it?Check out the tutorial at http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html#renderer
-
Hi
I been trying to create a JTable with a custom combobox, that is in a column the lists contained within each combobox is unique. I tried using a renderer, even though the combo appears I cannot select the combo for editing. Any suggestions on how to get the combo working properly would be appreciated thanks.It's been a few years since I did something like this, but my recollection is that you should implement the TableCellEditor interface and have the getTableCellEditor method return your custom combo box. Then, either override getCellEditor in your JTable to return your custom TableCellEditor or (better) call tableColumn.setCellEditor for the column you're interested in, passing an instance of your TableCellEditor. I suggest you return the same JComboBox from your implementation of getTableCellEditor every time, and either replace the underlying model or have a custom model in which you can easily switch the contents on-the-fly.
Having done this in the past, I remember that it's quite easy to leak stuff - I wouldn't advise making a new JComboBox every time.
Regards,
Huw -
Data provider problem in custom item renderer
I have a complex, custom item renderer for a list. I add
items that I extracted from an xml to the data provider using the
IList interface. But when displaying the list, the items are all
screwed up. Each rendered item has some parts which are initialized
as different components depending on the values from the xml. This
initialization is called in the item renderer for the
creationComplete event.
The weird thing is that when I output the dataProvider to
check its values, some of the items have internal uids sometimes
and sometimes they don't. If I output the dataProvider right after
I add the items to it, none of them get internal uids. But from the
initialize method, some of them do and some don't.
To make things weirder, sometimes, as I scroll up and down
the list, the dynamic components get all switched up. I'm either
having a problem with internal uids or with the creation policies
for lists. Or it's probably some simpler mistake I have yet to see.
Anyone have any idea where the problem could lie? Any help is
greatly appreciated.Any successful render must:
1) override the set data property of the component
Further, best practice is to store any data you need in the
override set data(), and call invalidateProperties(). Then do the
actual work in an override commitProperties() function.
The framework is smart about when to call commitProperties
efficiently. set data() gets called much more often.
Tracy -
Event Handling in JTable Custom Cell Renderer
I have a JLabel as a custom cell Renderer for a column. I want to handle mouse click event for the JLabel rendered in the cell.
I tried adding the listener for the label in the custom cell renderer but it is not working. Any ideas how to handle this problem??
Thanks
S.AnandIf you want to handle the selection of a tree node
1) write a class like:
public class TreePaneListener implements TreeSelectionListener {
// TREE SELECTION LISTENER
public void valueChanged(TreeSelectionEvent e) {
JTree tree = (JTree)e.getSource();
DefaultMutableTreeNode node = null;
int count = 0;
boolean doSomething = false;
if(tree.getSelectionCount() > 1) {
TreePath[] selection = tree.getSelectionPaths();
int[] temp = new int[selection.length];
for(int i =0; i < selection.length; i++) {
// Check each node for selection
node = (DefaultMutableTreeNode)selection.getLastPathComponent();
if(node.getLevel()==2) {
// Change this code to take the action desired
doSomething = true;
2) After creating the tree register the listener
TreePaneListener handler = new TreePaneListener();
tree.addTreeSelectionListener(handler); -
Custom Resource Renderer not coming on Implementing Flexible UI Components
HI,
I am using the Sneak Preview NW2004s SP9 with TREX .
I have to modify the search result list as returned by the TREX using the default search, basically have to include a custom Link based on the resource name.
I am trying to run the examples from the Knowledge Management and Collaboration Developer's Guide - "How to Implement Flexible UI Components".
I deployed the par file for the sample application "Using Flexible UI Ready-Mades"
and followed the steps as outlined below:
System Administration>System Configuration>Knowledge Management -->Content Management
1) Under
User Interface->Mapping>Resource Renderer
Created a new mapping for the java class com.sap.km.ui.renderer.SimpleResourceRenderer
2) Then under
User Interface->Settings>Resource Renderer Settings
Created a duplicate of SearchResourceRenderer
and in the copy changed the Resource Renderer to the custom one(as the one mapped in previous step).
In the Search Result layout Set, i changed the Resource Renderer Name to the custom one.
Now i restarted the server.(i tried restarting after almost all the steps )
But my resource renderer is not coming after i execute the TREX Search.The list returned seems to use the default Resource Renderer.
I even tried by making an advanced copy of the Search Layout Set, changed the Resource Renderer name, updated the OTH file(search.oth), Switched on the degugging for the WdfProxy and reloaded the OTH.
Now the new layout Set is being used but still i cannot see the result as per the custom resource renderer.
Morover, if i try to print some message from the resource renderer code(Component render method), it is not printed in the default Trace file.
Please help me in identifying and resolving the problem.
Thanks,
SiddharthaHi Detlev,
Sorry for the delay.
We don't want to exlude the folders, we would like keep it, the problem is, instead of appearing the folder name, is displayed the error message and below the actions (details, delete, ).
At first, we thought that could have been an error in the configuration of LayoutSet, but then, we tried on other two environments, with the default LayoutSet configuration and we still get, on the three environments, the same error message.
Any idea?
Thanks and Regards,
John -
Hi again, developers:
I'm in a search of a datagrid with certain characteristics:
- variableRowHeight = "true"
- only one column
- each row must have a custom item renderer with possibly different heights, and a fixed width
- the datagrid must show always every item in the data provider with no vertical scroll bars, what means that the datagrid height must have always the exact height sum of all the item renderers it is displaying.
- and no extra empty rows must appear in the last positions of the datagrid
The last two requirements are something difficult to achieve... for some reason, empty rows appear at the last positions of the datagrid. I post what i've managed to get:
<mx:Script>
<![CDATA[
private function resize():void
if (dg.dataProvider)
var h:Number = dg.measureHeightOfItems( -1, dg.dataProvider.length);
dg.height = h;
]]>
</mx:Script>
<mx:DataGrid id="dg" width="530" horizontalCenter="0" verticalScrollPolicy="off"
dataProvider="{dp}"
wordWrap="true" variableRowHeight="true" showHeaders="false" dataChange="resize()" height="{dg.measureHeightOfItems(-1,dg.dataProvider.length)}" click="Alert.show(dg.rowCount.toString());">
<mx:columns>
<mx:DataGridColumn headerText="ID" width="50">
<mx:itemRenderer>
<mx:Component>
<mx:TextArea height="{Math.random()*100}" wordWrap="true" backgroundColor="{Math.random() * 16777216}" paddingTop="0" paddingBottom="0"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>Thanks Harui, but it doesn't help. If the border is set it will help, but the very big problem is the empty rows that appear at the end of the datagrid... I can't find a way of measuring correctly the height of the itemRenderers!
I'll update this thread if I manage to do it. -
Range component in custom item renderer
Hi,
I am trying to put a spark Range component into the labelItemRenderer for flex mobile. Everytime I add it I get the error: "Skin for (long directory name for my range component) cannot be found". The custom item renderer is an actionscipt class because I read this is the best way to make them for mobile. I'll put the error in the bottom of the post.
If anyone has any idea why this could be happening or if anyone knows a possible way around this it would be extremely helpful. I basicaly just need a list where each item has a label on side and then a progress bar on the other side.
Thanks.
Here is the full error, ill put a star on the line where the addChild method gets called in my item renderer for the range component.
Error: Skin for HoosFit0.TabbedViewNavigatorApplicationSkin5.tabbedNavigator.TabbedViewNavigatorSkin7.con tentGroup.ViewNavigator1.ViewNavigatorSkin12.contentGroup.
FCfacilities139.SkinnableContainerSkin141.contentGroup.Group143.facilityList.ListSkin145.S croller147.ScrollerSkin148.DataGroup146.FCfacilitiesInnerClass0_157.Range154 cannot be found.
at spark.components.supportClasses::SkinnableComponent/attachSkin()[E:\dev\4.y\frameworks\pr ojects\spark\src\spark\components\supportClasses\SkinnableComponent.as:698]
at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[E:\dev\4.y\frame works\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:443]
at spark.components.supportClasses::SkinnableComponent/createChildren()[E:\dev\4.y\framework s\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:406]
at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UI Component.as:7634]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
at mx.core::UIComponent/addChild()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UICo mponent.as:7176]
*** at views::itemRenderer2/set data()[/Users/evan/Documents/Adobe Flash Builder 4.6/HoosFit/src/views/itemRenderer2.as:73]
at spark.components::SkinnableDataContainer/updateRenderer()[E:\dev\4.y\frameworks\projects\ spark\src\spark\components\SkinnableDataContainer.as:606]
at spark.components.supportClasses::ListBase/updateRenderer()[E:\dev\4.y\frameworks\projects \spark\src\spark\components\supportClasses\ListBase.as:1106]
at spark.components::DataGroup/setUpItemRenderer()[E:\dev\4.y\frameworks\projects\spark\src\ spark\components\DataGroup.as:1157]
at spark.components::DataGroup/initializeTypicalItem()[E:\dev\4.y\frameworks\projects\spark\ src\spark\components\DataGroup.as:327]
at spark.components::DataGroup/ensureTypicalLayoutElement()[E:\dev\4.y\frameworks\projects\s park\src\spark\components\DataGroup.as:384]
at spark.components::DataGroup/measure()[E:\dev\4.y\frameworks\projects\spark\src\spark\comp onents\DataGroup.as:1467]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8506]
at mx.core::UIComponent/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\ UIComponent.as:8430]
at mx.managers::LayoutManager/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx \managers\LayoutManager.as:665]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:816]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1180]Hi,
I am trying to put a spark Range component into the labelItemRenderer for flex mobile. Everytime I add it I get the error: "Skin for (long directory name for my range component) cannot be found". The custom item renderer is an actionscipt class because I read this is the best way to make them for mobile. I'll put the error in the bottom of the post.
If anyone has any idea why this could be happening or if anyone knows a possible way around this it would be extremely helpful. I basicaly just need a list where each item has a label on side and then a progress bar on the other side.
Thanks.
Here is the full error, ill put a star on the line where the addChild method gets called in my item renderer for the range component.
Error: Skin for HoosFit0.TabbedViewNavigatorApplicationSkin5.tabbedNavigator.TabbedViewNavigatorSkin7.con tentGroup.ViewNavigator1.ViewNavigatorSkin12.contentGroup.
FCfacilities139.SkinnableContainerSkin141.contentGroup.Group143.facilityList.ListSkin145.S croller147.ScrollerSkin148.DataGroup146.FCfacilitiesInnerClass0_157.Range154 cannot be found.
at spark.components.supportClasses::SkinnableComponent/attachSkin()[E:\dev\4.y\frameworks\pr ojects\spark\src\spark\components\supportClasses\SkinnableComponent.as:698]
at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[E:\dev\4.y\frame works\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:443]
at spark.components.supportClasses::SkinnableComponent/createChildren()[E:\dev\4.y\framework s\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:406]
at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UI Component.as:7634]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
at mx.core::UIComponent/addChild()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UICo mponent.as:7176]
*** at views::itemRenderer2/set data()[/Users/evan/Documents/Adobe Flash Builder 4.6/HoosFit/src/views/itemRenderer2.as:73]
at spark.components::SkinnableDataContainer/updateRenderer()[E:\dev\4.y\frameworks\projects\ spark\src\spark\components\SkinnableDataContainer.as:606]
at spark.components.supportClasses::ListBase/updateRenderer()[E:\dev\4.y\frameworks\projects \spark\src\spark\components\supportClasses\ListBase.as:1106]
at spark.components::DataGroup/setUpItemRenderer()[E:\dev\4.y\frameworks\projects\spark\src\ spark\components\DataGroup.as:1157]
at spark.components::DataGroup/initializeTypicalItem()[E:\dev\4.y\frameworks\projects\spark\ src\spark\components\DataGroup.as:327]
at spark.components::DataGroup/ensureTypicalLayoutElement()[E:\dev\4.y\frameworks\projects\s park\src\spark\components\DataGroup.as:384]
at spark.components::DataGroup/measure()[E:\dev\4.y\frameworks\projects\spark\src\spark\comp onents\DataGroup.as:1467]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8506]
at mx.core::UIComponent/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\ UIComponent.as:8430]
at mx.managers::LayoutManager/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx \managers\LayoutManager.as:665]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:816]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1180] -
How to implement custom field renderer?
I'm trying to create a custom field renderer that will render certain database fields as checkboxes in HTML. I'm using the Data Web Beans/JSP approach. In my view object I have added a "Boolean" property to the attributes that represent boolean type fields (e.g., field Warranty to indicate if an asset is under warranty). I have created a CheckBoxField() class similar to the TextField() class, and call it if the attribute is a boolean, but I can't figure out how to set the custom field renderer. When the program runs, it still uses the TextField renderer. The JDeveloper online documentation doesn't say anything about it. Is there a sample program or some other documentation that implements a custom field renderer?
Hi,
this document in addition
http://www.oracle.com/technology/products/jdev/howtos/10g/jaassec/index.htm
has a list of LoginModules, one that authenticates against physical database users
Frank -
Row Selection problem in custom cell renderer
Hi,
I have created a custom cell renderer to set color in my table based on some value and the screen also shows colors when i set this cell renderer.
But, I am not able to see the row selection ie. with blue background when I select any row in the table is nor appearing. Can you tell me how to solve this problem.
Regards,
R.Vishnu Varadhan.Check out this [url http://forum.java.sun.com/thread.jsp?forum=57&thread=507001]thread for a similiar example.
-
Hi all,
My situation is that I need to be able to, when uploading a document to KM and according to the value that takes a custom property, show only a specific group of properties on the screen.
I'm trying to solve this by developing a custom group renderer. Within the renderer I can get the value of a property, then according to this value I would want to load the specific structured group using its name and render it inside my current structured group renderer.
The problem is that I've haven't been able to create/load the structured group, how is this done?
Also I could try to do it with a custom property renderer that modifies the contents of its containing structured group. Is this possible?/how could I do this?
From what I've seen the KM creates all the Structured Groups when CM loads and pass only the minimal parameters to the group/property renderers limiting what can be done from a dynamic loading of properties point of view. What should I do to be able to extend the logic, not only the way that static properties are painted/rendered?
I'd like to know what you think.
Thanks in advanced,
Andrés
This topic is derived from this one because nodoby could help me there. Custom Group RendererHi Patricio,
Thanks for your answer. Could you please help me with some doubts that I have?
1. In the ResourceType creation it asks for a Resource Type ID, I don't know what to put in there, at help.sap.com it shows it in a URLish form. What should I put here?
2. Also, in Custom Properties is it a comma separated values of the Ids of the properties?
3. How do I pass the ResourceType to the new command that I will create? What is the format of the "parameters" parameter.
If you could provide some references/procedures that I can look into I'd appreciate it.
Thanks in advanced,
André -
Writing a Custom Property Renderer
Hello all,
I am new to KMC development. I want to know how to go about writing a custom property renderer. Detail step by step instructions as to where to start and what are the configurations, etc. would be a great help for me.
Thanks in advance.
Vicky R.Hello Vicky,
Step by Step guide to creating Property renderer is:
1. Program an implementation of AbstractPropertyRenderer.
2. Implement a RFServerWrapper service to register your property renderer with CrtClassLoaderRegistry.
CrtClassLoaderRegistry.addClassLoader(this.getClass().getClassLoader());
3. Technical mapping to your coding in the Property Metadata service.
4.Restart your server for the changes to take effect.
Check this link for more infos:
https://forums.sdn.sap.com/thread.jspa?threadID=41619
Also check the implementations of RFServerWrapper service in examples at this link:
http://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c739e546-0701-0010-53a9-a370e39a5a20
Greetings,
Praveen Gudapati -
How to get jsp PageContext in custom component renderer
Hi,
How to find PageContext(javax.servlet.jsp.PageContext) form within the custom component renderer class?
Please help?
Thanx & Regards
MilindStrictly you're looking which URL has invoked the new request? With other words, you want the referrer?
If so, doString referrer = request.getHeader("referer"); // Yes, with the legendaric misspelling.Be careful with this, the client has full control over what he/she sends with the headers, so also the referrer. It might be null or changed while you didn't expect that. If you want to be safe, you may consider to send the current URL as a hidden parameter along with the request. -
Using JScrollpane via Custom Cell Renderer.Please Help
Chaps,
I have a question regarding scrolling of a JList.
I have written a class (FTRDList) that has an Custom Cell Renderer.
I want the list to be scrollable.
This class is being called by many other classes.
Now,as the FTRDList class is being called by many classes,i need
to have all these classes to have the flwg statement
add(new JScrollPane(FTRDList)),BorderLayout.CENTER);
This can be a lot of work to chaneg all classes
Rather,is it possible to have the JScrollPane built in the
FTRDList class once and for all and let all classes call
it by
add(FTRDList,BorderLayout.CENTER);
Please can anyone tell me how to make the FTRDList class Scrollable?
Or is this not possible at all?
Attached is the class:
public class FTRDList extends JList {
/* Inner class for Custom Cell Renderer */
class MyCellRenderer extends JLabel implements ListCellRenderer {
public Component getListCellRendererComponent(JList list,
Object value, // value to display
int index, // cell index
boolean isSelected, // is the cell selected
boolean cellHasFocus) { // the list and the cell have the focus
setText(value.toString());
if (isSelected) {
setBackground(isSelected ? Color.red : Color.yellow);
setForeground(isSelected ? Color.white : Color.black);
setEnabled(list.isEnabled());
setOpaque(isSelected);
return this;
public FTRDList() {
super();
setSelectedIndex(0);
/** Invoke the cell Renderer */
setCellRenderer(new MyCellRenderer());
setOpaque(false);I HAVE ALSO POSTED THIS IN THE JAVA PROGRAMMING FORUM PLEASE DONT GET OFFENDED AS I AM EXPECTING AN URGENT RESPONSEWell, someone has probably already answered this question in the Java forum, so I won't waste my time and answer it again here.
Maybe you are looking for
-
Recovering data from iphone backup?
Hey guys, I am busting my head over here trying to figure out how to do this.. to make a long story short, I've had a very unlucky past few weeks. My iphone (4g 32gb) fell into the ocean and all the data I had is lost. But then I rememberd I can stil
-
Web site not visible in iweb, where did it go?
I created 2 web sites in iWeb. Posted 1 to mobilme. Now when i open iweb nothing appears and everything is greyed out in the top menu bar. Any idea where it has disappeared to and why i can't see it? Please help.
-
Issues during reinstallation Oracle 10g express edition and Forms 6i
I've been racking my head over this issue for the past two three days. Exasperated, I tried searching in the forums but could not find a specific scenario like this. I am facing issues while trying to get forms 6i to work with oracle 10g Express edit
-
Hi everyone. I have an old macbook pro which is still a great machine except the wifi doesn't work. I've had it serviced and it's just non functional, period. It still works wonderfully well when wired into ethernet port. I have purchased a macb
-
Just upgraded to Photoshop CC, vram help needed.
and get error regarding vram needing to be 512. I have 2 NVIDIA cards - one with 256 the other with 512-any help to resolve this?