Separator is not showing up in the JList that is set in the TextField
Hi,
This problem is really weird and I am tired trying to find the problem and so thought i ll ask u guys... i cant see any problem in the code below.. but when i run it the separator that i want if some condition is true it just dsnt come... i did debug it and it does actually go in the if condition but the separator is not showing up... i dont kno y...
I am pasting the code of the JList renderer SearchListCellRenderer that implements ListCellRenderer.......it has only one method....
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
JLabel label = null;
if (value != null){
label = new JLabel();/*(JLabel) defaultRenderer.getListCellRendererComponent(list, value, index,
isSelected, cellHasFocus);*/
if(!anatomySeparator && anatomyMap.containsKey(value.toString().toLowerCase())){
label.setVerticalTextPosition(SwingConstants.BOTTOM);
label.setPreferredSize(new Dimension(300, 80));
label.setText("<html><body>" + "<p style='color:white;'><b>--------------Anatomy--------------</b></p>" + "<p style='color:white;'><b>" + value.toString() + "</b></p></body></html>");
anatomySeparator = true;
logger.debug("in anatomy");
}else if(!diseaseSeparator && diseaseMap.containsKey(value.toString().toLowerCase())){
label.setVerticalTextPosition(SwingConstants.BOTTOM);
label.setPreferredSize(new Dimension(300, 80));
label.setText("<html><body>" + "<p style='color:white;'><b>---------------Diseases----------------</b></p>" + "<p style='color:white;'><b>" + value.toString() + "</b></p></body></html>");
diseaseSeparator = true;
logger.debug("in disease");
}else if(!propSeparator && observationMap.containsKey(value.toString().toLowerCase())){
label.setVerticalTextPosition(SwingConstants.BOTTOM);
label.setPreferredSize(new Dimension(300, 80));
label.setText("<html><body>" + "<p style='color:white;'><b>-----------Observations----------------</b></p>" + "<p style='color:white;'><b>" + value.toString() + "</b></p></body></html>");
propSeparator = true;
logger.debug("in observation");
}else{
label.setPreferredSize(new Dimension(300, 30));
label.setText("<html><body><p style='color:white;'><b>" + value.toString() + "</b></p></body></html>");
return label;
If i see the output the list in the JList is bold also in the condition i have the label size larger so in some values the label is actually large than others... that means it does go in the if condition... but the separator that i have there it just dsnt show up... i dnt kno wat is wrong... can anyone pls help me with this????
This is how i set the autocopleter text field with the Jlist and its renderer... if that is of some help.....
JList list = new JList();
JPopupMenu popup = new JPopupMenu();
JTextComponent textComp;
private static final String AUTOCOMPLETER = "AUTOCOMPLETER"; //NOI18N
public SearchListCellRenderer renderer;
public AutoCompleter(JTextComponent comp){
textComp = comp;
textComp.putClientProperty(AUTOCOMPLETER, this);
JScrollPane scroll = new JScrollPane(list);
scroll.setBorder(null);
list.setFocusable( false );
list.setBackground(Color.DARK_GRAY);
list.setForeground(Color.WHITE);
renderer = new SearchListCellRenderer();
list.setCellRenderer(renderer);
scroll.getVerticalScrollBar().setFocusable( false );
scroll.getHorizontalScrollBar().setFocusable( false );
popup.setBorder(BorderFactory.createLineBorder(Color.black));
popup.add(scroll);
if(textComp instanceof JTextField){
textComp.registerKeyboardAction(showAction, KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), JComponent.WHEN_FOCUSED);
textComp.getDocument().addDocumentListener(documentListener);
}else
textComp.registerKeyboardAction(showAction, KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, KeyEvent.CTRL_MASK), JComponent.WHEN_FOCUSED);
textComp.registerKeyboardAction(upAction, KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), JComponent.WHEN_FOCUSED);
textComp.registerKeyboardAction(hidePopupAction, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_FOCUSED);
popup.addPopupMenuListener(new PopupMenuListener(){
public void popupMenuWillBecomeVisible(PopupMenuEvent e){
public void popupMenuWillBecomeInvisible(PopupMenuEvent e){
textComp.unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
public void popupMenuCanceled(PopupMenuEvent e){
list.setRequestFocusEnabled(false);
}
If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
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.
Similar Messages
-
I have an iphone 5s and when I make a playlist on itunes for music videos and sync my iphone the playlist does not show up. What can I do to fix the problem?
Version 11.1.5.5 of iTunes was just released today. If you update to that, does that help with the recognition troubles?
http://www.apple.com/itunes/download/ -
my iphone is able to charge when i connect it to my computor, but no matter what i do, will not show up on itunes. i have tried resetting both the computer and the iphone and nothing is working.
Type "ipad not recognized in itunes" or similar into the search bar at the top of this page by "Support".
-
I purchased three autobooks from itunes last weekend and after updating my ios to 7 they no longer appear. I looked at my purchse history and they are not showing in my purchase history. I do have the receipts for the charge. How do I restore these?
"I did make a full back up of my phone prior to updating the iOS"
Itunes content is not incliuded in the backup that itunes performs.
Audiobooks are not part of icloud and cannot be redownloaded.
You can try contacting itunes support and asking for an exception. -
I have downloaded ADE 3 on my macbook. It did recognize my Aluratek Libre the first time I used it but now it does not. I plug my libre in start ADE and the Libre does not show up for me to transfer my ebooks from the library to my libre. Help pls
If you have iTunes 11 on your computer then you can enable the left-hand sidebar on it via option-command-S on a Mac, control-S on a PC - when connected (and if your computer's iTunes is up-to-date) your iPad should then appear on that sidebar under a 'Devices' heading :
If you select the iPad on that sidebar you can then use the Movies tab on the right-hand side of the iTunes screen to select and sync that film to your iPad's Videos app.
Has your iPad been synced to the computer before ? If not then you might find this page for syncing to a new computer useful : https://discussions.apple.com/docs/DOC-3141 -
I want to add a CD to my IPod Classic, the CD has been loaded into my library but my iPod is not showing on i-tunes and I can't get the CD onto my iPod.
Well if your iPod is not appearing under Devices in iTunes when you have it plugged into a high powered USB 2.0 port, then that would explain why this newly loaded CD has not synced to it yet.
Have you carefully worked through each and every single suggestion in this Apple support document?
iPod not recognized in 'My Computer' and in iTunes for Windows
B-rock -
When using the spot removal tool, the sampled area is not showing. I fully remember that I am seeing this before--I already had updates of my LR5
Is this just a setting?Thank you! I feel so stupid -- I did search the internet--maybe not hard enough.
-
How can i get music to not show up on my phone that i dont want there
how can i get music to not show up on my phone that i dont want there
If the app is G-Toolkit and you have a Gmail app on your iPhone, delete the Gmail app. Apparently the G-Tool kit is tied to a Gmail app. From searching the web my impression is that G-Toolkit is not spyware and is from a legitimate company that produces app for several platforms.
-
* Installed Firefox 9
* I am running Windows 7 64-bit
* I have Firefox pinned to the task bar.
* When Firefox opens, there is a new icon that opens up on the task bar. Normally, Firefox would open within the icon that is pinned to the task bar.
* When I close Firefox, the extra icon goes away.
* Firefox is acting like the icon that is pinned to the task bar is not even there.Before attempting the steps below, I would highly suggest you visit the latest known issues for the current version, specifically FF 9 release notes.
See:
[[Latest Firefox issues]]
1. Unpin the old firefox icon
2. Go to c:\Program File (x86)\Mozilla Firefox\
3. Double click on "firefox.exe" (FF window & icon will appear in supertaskbar)
4. Pin this new icon by right clicking > Pin to Taskbar (Firefox Icon turns into whitebox)
5. Make sure that you see the hidden folders
[[windows.microsoft.com/en-US/windows7/Show-hidden-files]]
6. Go to C:\Users\%yourusername%\AppData\Local
7. Delete "IconCache.db"
8. Open the taskmanager
9. Kill explorer.exe by clicking on End Process
10. In the taskmanager, File -> New Task (Run...) --> write "explorer.exe" without the quotation mark, press ok -
Just wondering why my comments on Facebook do not show via iOS. Is there any setting I need to make on my iPhone 5,I love this phone. Thanks
Someone else may have a workaround, but, as far as I know, if you cannot interact with the screen on the iPhone, there is no way to unlock it so you can get to your contacts.
Were you saving them to iCloud by chance? If so, you can restore them to your new phone.
~Lyssa -
my ipad is having trouble with my music... i had recently gotten a new one when i signed into my icloud the music that i had on the orignal one was not there.... some songs were in fact there but not clickable ( it was there only gray)... i was looking for help on how to get the music on the ipad
my ipad is having trouble with my music... i had recently gotten a new one when i signed into my icloud the music that i had on the orignal one was not there.... some songs were in fact there but not clickable ( it was there only gray)... i was looking for help on how to get the music on the ipad
-
My mac's launchpad is working but i am not able to use the apps that are provided in the launchpad
my mac's launchpad is working but i am not able to use the apps that are provided in the launchpad
Well, everything that you have bought with her Apple ID prior to getting your own Apple ID is forever hers. Apple will not transfer content from one ID to another. But in the case of the Mac, contact iTunes Customer Service and request that they send your issue to the Account Security Team and ask that the Mac be released form your mother's account so you may register it with your account. Then you can accept the iLife apps into your account for any future updates.
iTunes Support -
http://www.apple.com/support/itunes/ -
I tried to update the App that I purchased but the message told me that my Apple account is not valid for use outside of US and I must switch back to US store to able to do it. How can I switch the account from foreign countries back to US?
On your phone (from http://support.apple.com/kb/ht1311):
Change your iTunes Store country
Sign in to the account for the iTunes Store region you'd like to use. Tap Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
Follow the onscreen process to change your region, agree to the terms and conditions for the region if necessary, and then change your billing information. -
i want to create an appleid and i dont have credit card. the instruction that you discribe at the top is not working in itune 11.1.3 and iphone 5s. what should i do
We are fellow users here on these forums, you're not talking to iTunes Support nor Apple.
You need to follow, exactly, the instructions on that HT2534 page when creating an account (the instructions won't work with existing accounts) - I've just tried it and I got the 'none' option.
e.g. on my computer's iTunes I logged out of my existing account, found a free app in the store and clicked on its free 'price' :
I then clicked on 'create Apple id' on the popup :
Agreed to the terms, filled in my details, and got the 'none' option on the payments screen : -
Does not play correct ringtones that are set for the Caller and Rings when no one is calling
I have had my Droid Global for around and three months and from the beginning I have had issues with the ringtones ringing when a certain person calls me. Instead, it seems, it will play the rigntone that is applied to the last person that called me instead of the person who is actually calling me. This can be somewhat frustrating and kind of defeats the purpose of applying rigntones to people in the first place.
Also, just recently my phone has decided to ring all by itself...without any incoming calls, notifications...nothing. It does a very quiet ring that sounds similar to that of a house telephone or landline phone. It does not stop unless someone calls me or if I take my battery out and reset my whole phone. My phone has only done this twice and unfortunately it once happened in one of my college classes and I couldn't get it to stop.
Please help me...I don't know what I can do to fix this!!!Hi Cargo23,
I am sorry to hear you're having issues with your phone not ringing. In what zip code were you located when this issue occurred? Are you using your vehicle's bluetooth when this happens? Please try a soft reset to refresh your connections http://vz.to/1nLXk5g.
Thank you!
EdW_VZW
Follow us on twitter @VZWSupport
Maybe you are looking for
-
IPhone Synchronisation - STOP!!
Every other day, when I switch on my iPhone, I have the image on screen to connect the iPhone to my PC to synch with iTUne. How do I stop this from happening? thank you,
-
Join two tables to one recordset with nested table?
Hello all! I want to "de-normalize" two tables into one for presentation reasons. For example: CREATE TABLE foo(id number) CREATE TABLE bar(foo_id number, value varchar2(4)) And with some data: FOO: 1 2 BAR: 1, 'gaz' 1, 'boz' 2, 'blah' Now I want to
-
Computer crashes while using Photoshop
I have Windows Vista, 3 GB of RAM, and am using CS3. There are times when I use certain tools in Photoshop (as well as Illustrator) that will cause my computer to shut down or crash without warning. The tools that seem to trigger this shut down is th
-
Can we perform Join operation using SQLCall with Datatabae Query
Hi, I am working on Toplink SQLCall query. I am performing join operation but, it is giving error. so please, any can tell me . we can perform join operation using SQLCall with Database Query Thanking You.
-
XP update wrecks my screen resolution on Qosmio G10-133
I am running a two years old G10-133. Great and reliable machine. The reason I bought it was because it has great screen resolution/sharpness for MS Word texts and Outlook emails. For various reasons I do not download the MS Windows updates that are