Is it possible for a JList to have multiple columns..

And also at the same time have its header also.
Thanks in advance.

Try this
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.text.*;
public class SOSTester extends JFrame {
     public SOSTester() {
          JFrame thisFrame = new JFrame("Testing");
          Container thisCont = thisFrame.getContentPane();
          thisCont.setLayout(new BorderLayout(5,5));
          //// Start Testing
          String[] testList1 = new String[]{"AB","CD","EF"};
          JComboBox jcb = new JComboBox(testList1);
          jcb.setRenderer(new myRen());
          thisCont.add(jcb);
          //// End Testing
          thisFrame.pack();
          thisFrame.setBounds(200,200,400,50);
          thisFrame.setVisible(true);          
     public static void main(String args[]) { new SOSTester();}
class myRen extends JPanel implements ListCellRenderer
     JPanel testPanel = null;
     //JPanel thisPanel = null;
     JLabel text1 = null;
     JLabel text2 = null;
     myRen()
          text1 = new JLabel("",10);
          text2 = new JLabel("",10);
          testPanel = new JPanel();
          testPanel.setLayout(new GridLayout(1,2));
          //testPanel.setLayout(null);
          testPanel.add(text1);
          testPanel.add(text2);
          //thisPanel = new JPanel(new BorderLayout(0,0));
          //thisPanel.add(testPanel, BorderLayout.CENTER);
     public Component getListCellRendererComponent(JList list, Object value, int idx, boolean isSel, boolean hasFocus)
          if (value!=null)
               text1.setText(((String)value).substring(0,1));
               text2.setText(((String)value).substring(1,2));
               //text1.setBounds(5,0,20,25);
               //text2.setBounds(25,0,20,25);
          testPanel.setBackground((isSel)?list.getSelectionBackground():list.getBackground());
          testPanel.setForeground((isSel)?list.getSelectionForeground():list.getForeground());
          //testPanel.setSize(30,30);
          return testPanel;
}

Similar Messages

  • In a hierarchical query, is it possible for a row to have more than one immediate ancestor?

    Hi
    Question:
    In a hierarchical query, is it possible for a row to have more than one immediate ancestor?
    Answer:
    No
    No?  Surely, it's yes?
    Thanks,
    Jason

    As Frank pointed out already hierarhical most often means a tree (data structure) to deal with.
    There must usually be just one boss (the root) in which case the answer is no.
    Something to read: http://en.wikipedia.org/wiki/Tree_(data_structure)
    You can find out Solomon spoke about a generalization therein.
    Related to forum troubles:
    If I login first thing after reaching forum, the behaviour is rather consistent - I'm allowed to post answers, otherwise ...
    Regards
    Etbin

  • Is it possible for an Array to have zero element??

    As the subject stated, is it possible for an Array to have zero element apart from being null??
    because if I dont assign an Array to any amount of elements, the Array is always null. And, that is the reason why I never see Array.length being zero.
    Any body can explain??

    As the subject stated, is it possible for an Array to
    have zero element apart from being null??Well, let's see. new int[1] creates an array with one element, so if it IS possible to have an array with zero elements, how do you suppose you'd do that?
    Okay, right.
    Now, what happened when you put that into a .java file and compiled it?
    because if I dont assign an Array to any amount of
    elements, the Array is always null.If you don't assign a reference to an array to your array variable, (i.e. myArr = ... then it will be null (if it's a member variable, but undefined if it's a local).
    But null and empty are not the same thing. Remember, there's your variable, and there's the array it points to.
    Why do you think that the array it points to must have >= 1 elements?
    I'm not saying it's okay to have zero elemnts. And I'm not saying it's not.
    I'm asking you to examine your logic for why you think zero elements is not possible (said logic is faulty). And then I'm asking you to do an experiment to test your theory.
    And, that is the
    reason why I never see Array.length being zero.If you never see array.length being zero, it's because none of the arrays you looked at had zero elments. That doesn't tell you that arrays can't have zero elements.
    So far, you have neither theory nor observations to support either view.

  • I'm using outlook for my email and have multiple email addresses.  I would like to keep them separate, is there anyway to do this?

    I have multiple email accounts.  How can I keep them completely seperate in Outlook??  Right now ALL incoming emails come up all at the same time.  HELP!! 

    You need to ask Apple to reset your security questions; this can be done by phoning AppleCare and asking for the Account Security team, or clicking here and picking a method, or if your country isn't listed in either article, filling out and submitting this form.
    Changing the rescue email address requires supplying two of the answers. They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (105770)

  • Why does family sharing prevent one ID from having multiple families, it's not that uncommon for one person to have multiple families they're involved in.

    I was very disturbed to discover that Apple's family sharing only has the capacity for one family per ID. People nowadays are part of multiple families; whether through marriage or divorce, and those families don't necessarily want all their purchases shared with the other people. Why can't they just allow people to have multiple families, I understand there might be some complications with payment methods, but you could just let them choose which organizer they want to ask permission from, just like they would in a real family.

    I own the movies and I want them to stay in my iTunes library basically forever.
    But in both cases the file name no longer shows in the movie list, so I don't know how to re-download it from the Cloud.
    iTunes prefs > Store > Show iTunes in the Cloud purchases.
    This will show all your iTunes purchases in your library with a cloud icon down arrow. Click the icon to redownload or click on Play to stream without downloading.
    Also see this , -> Download past purchases
    and techncially, you don't "own" the movie, You simply have a license to use it.
    Yet the first thing iTunes does when you hit the delete key is tell you that it will remove the movie forever from all devices and the library.
    Actually, no it does not tell you that.
    FYI: You should keep copies of all yoru iTnue spurahses as the labels/movie studios/copyright owners can pull their product at anytime and it won't be available to redownload.
    Suggestions here -> http://www.apple.com/feedback/

  • Is it possible for me to sync to multiple computers using an external HDD?

    I just bought a 1TB external HDD and have all my music on it, as well as the installed and latest version of iTunes, as well I think I have the iTunes media file on there as well.
    So using all of those things is it possible to sync my iPhone 5 to multiple computers? Like can I start syncing on my Laptop and unplug and cancel the sync and continue it on my Desktop
    If there is I would imagine that it has to be either really easy or really complex. Either or I would like to know if it is possible!
    If you need any more info just ask and I could provide anything that isn't personal.

    Yes, if you have the entire library organized properly on the external drive then you can connect it to any computer running the same build of iTunes. See make a split library portable for details. You should also keep a backup on another drive.
    See also this post.
    tt2

  • Is it possible for text to span over two column?

    Gurus,
    I have a two column document and my Chapter/Book title has to be place center on page over the two column and the paragraph underneath is to be place in each column, i want to used only one text frame for all the text, can i span the Chapter title over the column or just make another frame?

    You can create frames anywhere you want. I usually do that -- move the 2 column frame down and insert a new frame at the top. You can connect the top frame with the rest, so the text runs through it (and you can see when and where text reflows), or you can simply let it exist as a stand-alone frame. In both cases you have to move the frame if you have a major text reflow.
    A cunning trick that might work for you is to insert a table instead. The table (one row, one column) can be dragged wider than its containing text frame. You will have to move down the text in the right hand side column manually, though.
    More control over columns is definitively on my wish list! In ye olde WordPerfect 4.0 (about 1984) one could switch columns on and off at will, anywhere on a page ...

  • Is there a way to have multiple columns of questions on my form?

    I'm trying to find if there is a way to have a segment of my form in a two column format because I have a lot of one line questions to ask (of which many will be left blank) and I don't want to overwhelm our clients with an excessive amount of scrolling.
    The format I am looking for would be roughly like this:
    Item One      [text input]        Item Five      [text input]
    Item Two     [text input]        Item Six        [text input]
    Item Three   [text input]        Item Seven    [text input]
    Item Four     [text input]        Item Eight     [text input]

    That's excellent news! Everything else about Forms Central is perfectly intuitive and just what we need. Once the multi-column capability is out, I think we will be set for a long time to come.

  • Can you have multiple databases on the same LUN in Exchange 2010?

    I'm sure you can but is it possible with exchange 2010 to have multiple databases on the same LUN.  We currently have 8 DB's all writing to their own DB drive and separate log drive so 16 drives in total.  I need to spin a new DB up this week and
    wanted to double check this is possible.  I've looked online and cant find anything that I've seen before that says this is possible.
    Thanks.

    Hi,
    Yes, multiple databases could be placed on the same LUN, but it's not recommended.
    If you have 2 drives fail at the same time (it happens more than you think), then losing 100% of your DBs is a lot worse than losing one of them or some of them depending on where the failures are.
    Here is a similar thread for your reference:
    Multiple databases on the same LUN in Exchange 2010
    Hope this helps!
    Thanks.
    Niko Cheng
    TechNet Community Support

  • Layout for multiple column

    Dear all,
    I have a layout setting that is supposed to have multiple columns. The first columns I have a fixed width in pixel (for example 120px), and the rest of the columns I want to set it in %. So, if the user resize its browser, the first column will stay 20px, while the rest will resize accordingly.
    What is the best way of doing this in JSC?
    thank you in advance

    1. In first, second, and third rows, I have a label
    and a text field. I want to left justify the label,
    and the textfield. So, using gridPanel with 2 columns
    will do the job.
    2. In the fourth, fifth, sixth row, I have 2 labels
    and 2 fields.In this order?
    I want to keep the left justify setting
    for the first label and textfield. If can't use the
    grid panel because the layout for each labels are not
    left justified with the same component in the first
    and second rows. Beside the width of each labels and
    textFields are not the same.That's why I'am not using the label attribute of TextField but separate Label components.
    Create a Grid Panel with 4 columns and drop into
    label1, textfield1, dummylabel11, dummylabel12
    label2, textfield2, dummylabel21, dummylabel22
    label3, textfield3, dummylabel31, dummylabel32
    label4, textfield4, label5, textfield5
    label6, textfield6, label7, textfield7
    label8, textfield8, label9, textfield9
    Create CSS classes for example as follows:
    *.gridlabel {...}
    *.griddata {...}
    Set the columnClasses attribute of the GridPanel to "gridlabel, griddata, gridlabel, griddata".
    To arrange more than one components in one cell of the GridPanel wrap them in a LayoutPanel without attributes.

  • Users have multiple AFP connections on server?

    Our server is running 10.6.7 and in Server Admin under AFP connection we are noticing users with multiple connections to server.  The settings are enabled to "disconnect users after they are idle" for 60 minutes and also "allow to sleep for 4 hours" checked.  I have 2 other servers with the same settings that average 60-80 connections but this server continues to average 250+ connections, many of which are multiple users from same IP address.  Does anyone have ideas as to why server isn't reseting connections?

    Who says the server isn't resetting connections? How do you know these connections are not active?
    It's not uncommon for one user to have multiple connections to a server, depending on your sharepoint configuration. Each shared resource will consume one connection for each user. This means that if your users' home directories are on the server, as well as a group sharepoint and a public share/dropbox, then each user would have three connections. Does that cover your usage?

  • I have an iPhone 4s that is no longer active on my account. I recently upgraded it after completing a 2-year contract. Is it still possible for me to have the iPhone 4s unlocked even though it is no longer active on my account?

    I have an iPhone 4s that is no longer active on my account. I recently upgraded it after completing a 2-year contract. Is it still possible for me to have the iPhone 4s unlocked even though it is no longer active on my account?

        Great question missmar23. You can contact our Global Support department at 1-800-711-8300 to discuss the details for your device.
    KinquanaH_VZW
    Follow us on Twitter @vzwsupport

  • Is it possible for a mac to run across a Windows based server such as in a school, and still be able to access all networked folders? I have been told that macs can only read down a certain number of folders

    Is it possible to run a mac on a windows based server? We have a server based on Windows 7 in our school, and our techies are reluctant to let me buy a mac as they say macs can only read a number of folders deep, which would preclude me from accessing shared folders on our servers. Is this true, and is there a way round this? I would eventually like to get a suite of macs, but because all our resources are on the server, I have to be able to access them.
    Thanks for any help,
    Mike

    I have found that both Linux and Mac (unix) are capable of reading "deep" folders while win 32 will have issues, your it people are clearly wrong.  I run a network with both win/mac. And as long as the win servers/pc's that have shares are set to allow apple file sharing in their folder properties.   And the macs are set to allow smb there should absolutely no trouble with you accessing anything across the platforms, heck, from a Mac to a win pc on some occasions you don't even need to include a "domain" name to log on to, and you can create aliases and make your own shortcuts etc... So you don't have to manually connect each time you boot up etc... But that's all personal preferences I suppose.
    All I can tell you is that, I do it on a daily basis managing a small business. So your answer is yes you can.

  • TS3297 Is it possible for itunes on my MacBook Pro to play songs off my networked WD external hard drive and sync to my iPhone? I prefer to not keep all my music on my laptop and I don't want to pay $25 a year to access my songs if I don't have to.

    Is it possible for itunes on my MacBook Pro to play songs off my networked Western Drive external hard drive so I can sync to my Mac to my iPhone? I do not want to keep any music on my laptop and I don't want to pay $25 to itunes match a year to access my songs if I don't have to.

    Hi turingtest2,
    Thank you for replying.  I've been looking at your posts about setting up iTunes using an external drive.  A bit of background info.  My old computer broke down, so I got a new one from work.  I've always kept my music files on my external drive (I have around 170GB of music).  I didn't follow the suggestions in the "migrate iTunes library" post because my old computer died on me.  However, I've looked at your posts about lay out of the iTunes folders.  Before connecting to iTunes on the new computer, I had reorganized my iTunes folder on my E: external drive, and created an iTunes folder which contains an iTunes Media subfolder.  The music files are in a Music folder, which is in the iTunes Media folder.  I've also put the following files in my iTunes folder: iTunes Library.itl, iTunes Library Extras.itdb, iTunes Library Genius.itdb, iTunes Music Library.xml, as well as sentinel.  I then followed the advice you gave bmw99 on 2 Nov 2013 at 9.58 (sorry, can't copy the exact answer). 
    Just to clarify:  I'd like to keep all my music media on the E: external hard drive (the computer hard drive is too small), and I'm aware i might never have my playlists back, and that all the songs in my library might be ticked.  However, I don't want my library to be duplicated. 
    I'm at work at the moment, but will be back home in about 10 hours, so I can be more specific about folders / files names. 
    I'm glad you picked up my message and greatly appreciate your help.
    Patrice

  • Is it possible for the Adobe to put video instructions on these following things as my professor works on CS4 and I have CS6,it is really confusing for me to follow the disparitie between the two.

    Is it possible for the Adobe to put video instructions on these following things as my professor works on CS4 and I have CS6,it is really confusing for me to follow the disparitie between the two
    Modifying the header
    Changing page background color
    Changing sidebars in CSS
    Adding/changing a Spry link's background and hover colors in navbar
    Formatting headers in split view
    Deleting placeholder copy in the content container
    Inserting a video in a table
    Changing table background color
    Formatting text in the content container
    Format hyperlinks in CSS
    Insert page anchors and link to them with navbar hyperlinks
    Enter text in footer with a hyperlink
    Insert and format headers
      Use of a color picker (Color Cop)

    Use CS6 Help (F1).  Those are the most up to date articles for your product version.
    <Changing page background color>
    We've already told you how to do that with CSS code.
    <Deleting placeholder copy in the content container>
    Placeholders are deprecated.  Adobe removed them.
    <Inserting a video in a table>
    Insert > Media > HTML5 Video
    <Insert page anchors and link to them with navbar hyperlinks>
    Named anchors are deprecated in HTML.  Adobe removed them from DW.  Use Div IDs instead.
    Why are you taking a course that teaches outdated methods in CS4 which is no longer supported?
    Nancy O.

Maybe you are looking for

  • How do I add music from another iTunes program onto a new one?

    Hello! I recently downloaded Windows 8.1 onto my PC. I also had to download iTunes again, then I plugged in my iPod. Since I had to re-add all my music, I went into my iPod folders to find where I put my music (from before) to move it back into iTune

  • Feedback: search within attachments needed in mail

    Hello, I really need to be able to search within attachments within mail. Specifically I need to be able to search within attached PDF and Word documents, through my entire email store. it is important that it searches within all emails, regardless o

  • Has anyone multiplexed 5 or more cameras?

    Has anyone setup a system using a lot of cameras? I have an application that will require either 5 or 9 cameras. Speed is not a critical factor (the part will not be moving) but I'd like the acquire rate to be on the order of at least a second or two

  • Query on Workflow

    Hi Guru's, We are using Hyperion Planning 11.1.1.2 version and our requirement is users need work flow functionality whenever we transfer one employee expenses from one department to other department? I'm thinking this can be achieved in the follow w

  • C_TADM51_70 certification pass.

    Hi, I have got the certification scheduled in June,2011.For the C_TADM51_70 certification, what is the  qualifying  marks to pass the exam? has anyone recently attempted the exam and would like to provide on this query. I already read the details on