Controlling what cells are selectable or not in a JTable

Basically, I have a JTable and an abstract table model with 3 columns. I only want the first column to be selectable - I can't work out for the life of me how to do this! Like in a standard I.E. window when browsing your files (in View-details mode), you can only select the file, not it's properties.

table = new JTable(...)
     public void changeSelection(final int row, final int column, boolean toggle, boolean extend)
          if (column == 0)
               super.changeSelection(row, column, toggle, extend);
table.setColumnSelectionAllowed(true);

Similar Messages

  • Control what songs are on my Ipod touch when I'm out of WiFi coverage

    My iTunes library is much larger than my 4g Ipod Touch. with iTunes match can I control what songs are on my iTouch when I will be out of WiFi coverage.
    Thanks

    When I leave my house where I have WiFi coverage I want to select what songs I can play when I'm out of coverage. Because I have only 8 gig on my Ipod I can't download everything for offline use. I want to be able to choose what I have available when I'm off line. How can I do that?

  • How to Figure out what checkboxes are selected upon a button click...

    If I have a panel with some JCheckBoxes and a JButton, how can I figure out what checkboxes are selected upon the button click? If I add an actionlistener to the button, inside actionPerformed, how would I know what checkboxes are selected? One caveat is that the name and number of these checkboxes are dymanically chaing based on a configuration file so I do not know what the names of these check boxes are.
    Any help/code sample would be appreciated.

    Here's one of several different ways to do it. It attaches an ItemListener to each checkBox. When the checkBox is clicked, it is either added or removed from a List of selected items. Clicking the button will show you the selected items.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    public class CheckBoxTest extends JFrame
      JCheckBox chkChoice1 = new JCheckBox("English");
      JCheckBox chkChoice2 = new JCheckBox("French");
      JCheckBox chkChoice3 = new JCheckBox("German");
      JCheckBox chkChoice4 = new JCheckBox("Italian");
      JTextArea txaDisplay = new JTextArea(5, 20);
      JButton btnShow = new JButton("Show Selected Items");
      ArrayList <JCheckBox>choices = new ArrayList<JCheckBox>();
      public CheckBoxTest()
        super("");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        chkChoice1.addItemListener(new CheckBoxListener(chkChoice1));
        chkChoice2.addItemListener(new CheckBoxListener(chkChoice2));
        chkChoice3.addItemListener(new CheckBoxListener(chkChoice3));
        chkChoice4.addItemListener(new CheckBoxListener(chkChoice4));
        btnShow.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent event)
            txaDisplay.setText("");
            for (JCheckBox jcb : choices)
              txaDisplay.append(jcb.getText() + "\n");
        JPanel buttonPanel = new JPanel(new FlowLayout());
        buttonPanel.add(chkChoice1);
        buttonPanel.add(chkChoice2);
        buttonPanel.add(chkChoice3);
        buttonPanel.add(chkChoice4);
        JScrollPane scroll = new JScrollPane(txaDisplay);
        scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        JPanel dataPanel = new JPanel();
        dataPanel.add(btnShow);
        dataPanel.add(scroll);
        Container c = getContentPane();
        c.setLayout(new BorderLayout());
        c.add(buttonPanel, BorderLayout.NORTH);
        c.add(dataPanel, BorderLayout.CENTER);
        pack();
      public static void main( String[] args )
        CheckBoxTest frame = new CheckBoxTest();
        frame.setVisible(true);
      class CheckBoxListener implements ItemListener
        JCheckBox checkBox;
        public CheckBoxListener(JCheckBox checkBox)
          this.checkBox = checkBox;
        public void itemStateChanged(ItemEvent event)
          if (checkBox.isSelected())
            choices.add(checkBox);
          else
            choices.remove(checkBox);
    }Or, you could just maintain all the checkboxes in a Collection ahead of time. When the Show button is selected, simple query isSelected() on each item.
    Again, there are several different ways.

  • Save What songs are Selected for ipod transfered to new computer help

    okay here is the thing i got a new computer and i need to save what songs are selected and i got so many songs that it would take forever to go through ALL my songs and select which ones go on my ipod cause i like it on auto-update please tell me if there is a way to keep what is selected like a file that says it and stuff it will be very appreciated

    Start using smart playlists, and tell iTunes to update using te smart playlists you create.
    http://docs.info.apple.com/article.html?path=iTunesWin/5.0/en/674.html
    Don't fiddle with the checkmarks.

  • There are certain albums and songs I don't want my children having access to in iTunes Match through their iPod and iPad.  Is there a way to control what songs are visible on different devices?

    There are certain albums and songs I don't want my children having access to in iTunes Match through their iPod and iPad.  Is there a way to control what songs are visible on different devices?

    No.

  • Table Control on a report selection screen -not a dialog transaction screen

    Hi
    Does anyone know of a way to have table control functionality on a report selection-screen? The program needs to be able to run as a background job (ie cannot be a dialog transaction) and we need to be able to save variants with the selection-screen values.
    Any help would be appreciated.
    The key point is we want to allow the user to enter a dynamic number of rows of table data on the selection-screen, save a variant containing that data and execute the program with the variant as a background job.
    Thanks
    Nicole Knight

    Hi Nicole,
    The main problem is how to persist the data.  If you are not able to create a couple of tables then you could always utilise TVARV instead.  On a similar line to my original post you could have the button call a dialog transaction.  In here you could do your normal GUI table control.  When saving the data simply transpose each column into a separate select-option held on TVARV keyed by the 'variant name' + fieldname.  Then retrieve and transpose this back when executing the report.
    Other methods could be storing the data in cluster xy (see EXPORT TO DATABASE command).
    This seems a bit overkill for what would be a couple of maintenance dialogs.
    Cheers,
    Pete
    PS. The view cluster is just a way of hierarchically performing table maintenance across multiple related tables.  It offers a good UI for this purpose (header and item config tables) and is utilised extensively in the IMG.

  • Controlling what contacts are put on iPhones using same computer

    myself and 4 of my family have new iPhone 6's and use one iMac for updates etc.
    The problem is I also use this same iMac for my business and my business contact info also ends up on their
    iphones as well which they nor I do not want my info on their phones.    
    Is there a way to limit what contact info is put on their iPhones so that they do not get the business contact names etc.?
    Thanks
    Bob

    You're welcome

  • Cell(Row) Selection not display in OOPS ALV

    Hi all,
    I am not able to get the cell(row) selection in the oops ALV when i called it second time.
    I am displaying some information using oops alv  in 100 screen. After user action on 100 screen i am calling 200 screen with different information which is also display in oops alv. When i displaying information in second time the cell(row) selection is not getting displayed.
    For both ALV the fieldcatelog is different.
    Initially i tried using same container but i face same problem, so i am trying to call second alv in new screen.
    But problem remain same.
    Can anyone help me to solve this problem ?
    Regards
    Nilesh

    hi,
    can u send ur report  so dat i can look furhter to it.and help u out

  • How Do You Control the Order That Menu Items Are Selected

    I am using iDVD 6 with the Portfolio Theme (iDVD 5). I created a project with one 15-minutes iMovie project and seven slideshows (created in iDVD).
    In Preview mode (or with the final) DVD, the order that entries on the main menu are selected does not seem to follow a logical pattern. As I try to advance using the right cursor, the second item (horizontally) is skipped. (I have two rows, each with four items). When I have one of the other three items in that row selected, the second item is selected if I hit the down arrow.
    In 'flowchart view' the eight items are in the order I want them to be selected. That is, the item that is being skipped is in the second position on the flowchart.
    Any insight on this would be appreciated.
    PowerBook G4 1.33 Ghz (me) & FP iMac - 1.0 Ghz (kids)   Mac OS X (10.4.4)   iMac (for the kids)

    I created an iMovie and then exported to iDVD, iDVD used the same sequence as the iMovie. When you build you Movie or slide show it follows the sequence that you place them in the time line. I have a Slide Show movie with video clips in the time line all of the shows and clips play in the order that I placed them. When you move through the menu use the right arrow to move accross the menu and the down arrow to move down to the next row. There is an button to move to the next menu. I have 13 chapters in my iDVD and they appear on 3 menus. Each menu shows 6 buttons you can edit the button titles and reposition them if you deselect the snap to grid and select the other option. When I open my project after exporting the titles overlayed each other. The buttons picted up my iMovie titles so I had to fix them and reduce the type size and move the buttons to separate them. The time line sets the order and the arrow keys move throgh the buttons on you Mac screen you can select with the mouse by clicking the button. On a DVD player you are stuck with the arrows and enter keys on the remote. You may have a glitch in your data check the time line along bottom of your original to see if the chapter markers are in position.
    Richard
    1.25 GHz Dual G4 Desk Top Mac OS X (10.4.6)

  • JTable Cell text selection Problem.

    I am using Tab key while navigating with the Cells.While focus reaches into a cell,the cell is selected but not the cell content.So I use BACKSPACE to delete each word of the cell.I want to Select a cell content(i.e. Text) when I am move Tab keys to select cells.Please help me..........,u may send a mail at [email protected]

    Do u need this feature to the whole table or else for the perticular cell in the table?
    Are you using your own renderer or editor to the perticular cell ?,
    this issue is related to Renderer and Editor, so if i know your requirement , then only it is easy to implement.

  • Selection tool not working properly

    As I am dragging the tool it is selecting as it should but as soon as I stop dragging the area I was trying to select has a bunch of random sections which are no longer selected.  When I then try to add to the selection, it simply changes which sections are selected and not selected.  I cannot get it to just select as I want it to. 
    Therefor, when I select via layer I end up with this.
    Please help.

    Your using the quick selection tool in add mode with a large brush size and who knows what other brush settings.  Try reducing the brush size and play with the other brush setting too. Look at the black dash outline your selection compared to the one on her forehead made using a smaller brush. However even with a 25% space 96 px brush I have no problem selecting the background. Try resetting your preferences.

  • Colorblind users can't tell what apps are running

    There needs to be a setting under Dock Preferences to CHANGE THE COLOR of the dot under running applications in the Dock.
    I know the dot is there because I asked where the arrows went in the Apple Store and they told me it was there. After straining and squinting, I can almost see it. This is NOT ACCEPTABLE.
    With my color blind situation, I can no longer tell what apps are running or not. I have to press command-option-escape for force quit just to see what is running.
    Either bring back the Tiger black arrow, or allow a preference so that color blind users can tell what is going on.

    You bring up an excellent point but no one at Apple who can make the change is likely reading Discussions. Put in a request for the Dock improvement at Apple OS X Feedback where it will be put in Apple's system for user requests.
    http://www.apple.com/macosx/feedback/

  • Obvious Way to Tell How Many Files are Selected?

    I’ve been trying my best to love Lightroom, and I get close, but there’s one problem that I just can’t get past.
    Five minutes ago, I tried to export one photo, and I ended up exporting 52 photos.  This happens all the time. If I had a dime for every time I exported 500 photos instead of 1 photo, moved 500 photos instead of one photo, etc, I’d have a lot of dimes.
    Anyway, I deleted the 51 extra exports, synced the folder, got everything where I wanted it, then … exported 52 photos again.
    Sigh.
    The only way I’ve been able to avoid this is in the past is by obsessively pressing Command+D.  When I’m trying to do anything, I pound these two keys like there’s no tomorrow, but of course, I have to re-select the files I do want to perform actions on.
    I kept thinking I’d get used to it, but I’m still having problems to no end.  Unless I look very, very closely, I can’t tell if photos are selected or not, and if an entire screen full of photos are selected, they all look the same, so I really can’t tell.
    That’s the background, now my questions if I may:
    Is there any way to get a dialog box before performing actions on multiple photos?  Something that says, “this action will be performed on 1,871 photos, do you want to proceed?” or something to that effect?
    Ironically, it already does this when I want to delete something, which is great, but no such luck for any other actions.
    By any chance, is there something I can do to make the number of photos I have selected, more obvious?
    I know this is not a bug or program flaw, it’s a flaw with how my brain works with the program, but if I could figure out a way to make them work together , this application would be pretty awesome.  As it is, I spend more time undoing mistakes than I do organizing and editing photos.
    Thank you very much for any help.

    I am so pleased to read your post and realize I'm not the only one that gets tripped up by this! I've bee using LR extensively for more than two years now and even today, just now, I wanted to export ONE file, and the highlighting onscreen appeared to indicate I've selected one file, but turned out it was dozens of files. Now... when I'm simply exporting copies of files to another folder it's not a dangerous situation. BUT! It is very dangerous if one wishes to delete a file or several files and you think those are the only files you're deleting. Many, many times I have caught this in time, fortunately. To me this is one example of how the experience of software designers do not well understand how the end user will understand a program. Professional photographers are very specific with everything they do and don't want a program tripping them up continually. This obvious confusion over which files are actually "selected" needs cleared up.
    I read the responses to your post and find them dissatisfying. Please, Adobe, test your software with actual working photographers and not just Adobe engineers who may also happen to be amateur photographers.

  • What Drivers are you us

    I am using a Xtreme gamer and 2.5.006 drivers

    jerelot wrote:
    I read somewhere on HP's site that windows 7 drivers for this TX2 - 1027CA won't be available until October 2009. Still I am using it now, and the main system is running fine. There is an issue around the fingerprint reader, and possibly the webcam for me at this stage. Until HP delivers updated drivers, I wondered if there might be beta versions of drivers for the TX2 I might try. I'm willing to keep using windows 7, but I'd like to try to install updated drivers asap. That's possibly two months away, and one month into the OS availability to MSDN subscribers (many businesses and developers). I'm guessing there are some other people reading this list who have found what is and isn't possible on the TX2 today under 7. Would you mind giving us a brief run down on what drivers are working or not working? Fingerprint reader and webcam are of high interest for starters. My goal is to get working what can be working.

  • So, I'm new to Itunes and seem to be unable to download my selected tunes. What am I doing or not doing.  I seem to be following instructions, what little there are.

    So,I'm new to itunes and seem to be unable to download tunes to my computer.  The instructions make it so simple to sign on, but, not to download.

    Call Apple Care. They will either help you over the phone, or they will help you send it in for repair (it takes only a few days to do that - you usually have it back literally two or three days after you send it in)...What you are describing is something malfunctioning and that is NOT usual for a mac.

Maybe you are looking for