I am really stuck with JCheckBox using it as a JTable cell editor...

i need to focus next table cell, when user press a key on JcheckBox used in JTable as a cell editor.
Especially i need to bind "ENTER" key with this action. I tried to addKeyListener do checkbox, tried to add action into input maps of jatble, and also to input map of checkbox. But really nothing works. Please help....
Mathew, HSIGP

and yes your code works well with any key, but when i want to assign something to "ENTER", it doesnt work. F.ex. if i assign something to "A" key
like>
InputMap m=table.getInputMap(WHEN_ANCETSTOR...);
m.put(KeyStroke.get("A"),m.get(KeyStroke.get("TAB"));
it works fine, and when i press "a" key it work as a "tab" key in table.
But when i am doing same with "enter" instead of "a" it doesnt work.
btw. there is action "actionselectNextCollumn..." assigned by default to enter
why??

Similar Messages

  • Tab transversal while using JTextArea as a JTable cell editor..

    I'm working on a project that will use a JTable with a JTextArea cell editor to create a chart for classroom scheduling. Searching on Google, I found a way to use a JTextArea as a cell editor and render the cell properly. However, when editing a cell, pressing the Tab key inserts a tab, rather than leaving the cell and going to the next one, as happens with just a regular JTable. In fact, none of the keyboard shortcuts that work on a JTable work once the JTextArea cell editor is used. Does anyone know of any way to resolve this? Below is some code I'm using to create a sample GUI, just to verify that I can do this. Another question is would it be easier to use a bunch of JLabels and JTextAreas, remove the padding from those JTextAreas, and try to allow for Tab transversals between stand-alone JTextAreas, rather than JTextAreas as JTable cell editors?
    Thanks!
    package edu.elon.table;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class GUI
         private JFrame frame;
         private String[] columnNames = {"Classroom", "8:00-9:10", "9:25-10:35",
              "10:50-12:00", "12:15-1:25", "1:40-2:50", "1:40-3:20 (MW)",
              "3:35-5:15 (MW)", "5:30-7:10 (MW)"};
         private Object[][] data = {columnNames,
              {"ALAM 201 (42)\nENG 110 LAB", "", "", "", "", "", "", "", ""},
              {"ALAM 202 (42)\nDP/DVD", "", "", "", "", "", "", "", ""},
              {"ALAM 203 (38)\nDP/DVD", "", "", "", "", "", "", "", ""},
              {"ALAM 205 (40)\n", "", "", "", "", "", "", "", ""},
              {"ALAM 206 (39)\nSINK, TV/VCR", "", "", "", "", "", "", "", ""},
              {"ALAM 207 (40+)\nDP/DVD", "", "", "", "", "", "", "", ""},
              {"ALAM 214 (38)\nTV/VCR", "", "", "", "", "", "", "", ""},
              {"ALAM 215 (42)\nTV/VCR", "", "", "", "", "", "", "", ""},
              {"ALAM 216 (42)\n", "", "", "", "", "", "", "", ""},
              {"ALAM 301 (40)\nTV/VCR", "", "", "", "", "", "", "", ""},
              {"ALAM 302 (38)\nDP/DVD", "", "", "", "", "", "", "", ""},
              {"ALAM 304 (35)\nFRENCH", "", "", "", "", "", "", "", ""},
              {"ALAM 314 (30)\nDP, PSY, COMPUTER ASSISTED", "", "", "", "", "", "",
              {"ALAM 315 (40)\nPC LAB, DP/DVD", "", "", "", "", "", "", "", ""}};
         private JTable table;
         public GUI()
              frame = new JFrame();
              table = new JTable(data, columnNames);
              table.setRowHeight(table.getRowHeight()*2);
              TableColumnModel cModel = table.getColumnModel();
              TextAreaRenderer renderer = new TextAreaRenderer();
              TextAreaEditor editor = new TextAreaEditor();
              for (int i = 0; i < cModel.getColumnCount(); i++)
                   cModel.getColumn(i).setCellRenderer(renderer);
                   cModel.getColumn(i).setCellEditor(editor);
              frame.setLayout(new GridLayout(1,0));
              frame.add(table);
              frame.pack();
              frame.setVisible(true);
    public static void main (String[] args)
    GUI gui = new gui();
    * Written by Dr. Heinz Kabutz, found through online newsletter via Google.
    class TextAreaRenderer extends JTextArea
    implements TableCellRenderer {
    private final DefaultTableCellRenderer adaptee =
    new DefaultTableCellRenderer();
    /** map from table to map of rows to map of column heights */
    private final Map cellSizes = new HashMap();
    public TextAreaRenderer() {
    setLineWrap(true);
    setWrapStyleWord(true);
    public Component getTableCellRendererComponent(//
    JTable table, Object obj, boolean isSelected,
    boolean hasFocus, int row, int column) {
    // set the colours, etc. using the standard for that platform
    adaptee.getTableCellRendererComponent(table, obj,
    isSelected, hasFocus, row, column);
    setForeground(adaptee.getForeground());
    setBackground(adaptee.getBackground());
    setBorder(adaptee.getBorder());
    setFont(adaptee.getFont());
    setText(adaptee.getText());
    // This line was very important to get it working with JDK1.4
    TableColumnModel columnModel = table.getColumnModel();
    setSize(columnModel.getColumn(column).getWidth(), 100000);
    int height_wanted = (int) getPreferredSize().getHeight();
    addSize(table, row, column, height_wanted);
    height_wanted = findTotalMaximumRowSize(table, row);
    if (height_wanted != table.getRowHeight(row)) {
    table.setRowHeight(row, height_wanted);
    return this;
    private void addSize(JTable table, int row, int column,
    int height) {
    Map rows = (Map) cellSizes.get(table);
    if (rows == null) {
    cellSizes.put(table, rows = new HashMap());
    Map rowheights = (Map) rows.get(new Integer(row));
    if (rowheights == null) {
    rows.put(new Integer(row), rowheights = new HashMap());
    rowheights.put(new Integer(column), new Integer(height));
    * Look through all columns and get the renderer. If it is
    * also a TextAreaRenderer, we look at the maximum height in
    * its hash table for this row.
    private int findTotalMaximumRowSize(JTable table, int row) {
    int maximum_height = 0;
    Enumeration columns = table.getColumnModel().getColumns();
    while (columns.hasMoreElements()) {
    TableColumn tc = (TableColumn) columns.nextElement();
    TableCellRenderer cellRenderer = tc.getCellRenderer();
    if (cellRenderer instanceof TextAreaRenderer) {
    TextAreaRenderer tar = (TextAreaRenderer) cellRenderer;
    maximum_height = Math.max(maximum_height,
    tar.findMaximumRowSize(table, row));
    return maximum_height;
    private int findMaximumRowSize(JTable table, int row) {
    Map rows = (Map) cellSizes.get(table);
    if (rows == null) return 0;
    Map rowheights = (Map) rows.get(new Integer(row));
    if (rowheights == null) return 0;
    int maximum_height = 0;
    for (Iterator it = rowheights.entrySet().iterator();
    it.hasNext();) {
    Map.Entry entry = (Map.Entry) it.next();
    int cellHeight = ((Integer) entry.getValue()).intValue();
    maximum_height = Math.max(maximum_height, cellHeight);
    return maximum_height;
    * Written by Dr. Heinz Kabutz, found through online newsletter via Google.
    class TextAreaEditor extends DefaultCellEditor
    public TextAreaEditor() {
         super(new JTextField());
    final JTextArea textArea = new JTextArea();
    textArea.setWrapStyleWord(true);
    textArea.setLineWrap(true);
    JScrollPane scrollPane = new JScrollPane(textArea);
    scrollPane.setBorder(null);
    editorComponent = scrollPane;
    delegate = new DefaultCellEditor.EditorDelegate() {
    public void setValue(Object value)
    textArea.setText((value != null) ? value.toString() : "");
    public Object getCellEditorValue()
    return textArea.getText();
    }

    Using the KeyEvent manager and playing around with the JTextArea, I was able to get a JTable using JTextAreas as the cell editors that worked very close to the way the regular JTable works. You have to hit Tab twice to shift focus to another cell, or hit Tab once and then an arrow key. Also, Alt-Enter will allow you to enter a cell for editing. All of the changes were made to the TextAreaEditor class, which should now read as follows:
    class TextAreaEditor extends DefaultCellEditor implements KeyListener
         private int lastKeyCode;
         public TextAreaEditor(final JTable table) {
              super(new JTextField());
              lastKeyCode = KeyEvent.CTRL_DOWN_MASK;
              final JTextArea textArea = new JTextArea();
              textArea.setWrapStyleWord(true);
              textArea.setLineWrap(true);
              textArea.addKeyListener(this);
              textArea.setFocusable(true);
              textArea.setFocusAccelerator((char) KeyEvent.VK_ENTER);
              JScrollPane scrollPane = new JScrollPane(textArea);
              scrollPane.setBorder(null);
              scrollPane.setFocusable(false);
              editorComponent = scrollPane;
              delegate = new DefaultCellEditor.EditorDelegate() {
                   public void setValue(Object value) {
                        textArea.setText((value != null) ? value.toString() : "");
                   public Object getCellEditorValue() {
                        return textArea.getText();
         public void keyTyped(KeyEvent ke)
              // TODO Auto-generated method stub
         public void keyPressed(KeyEvent ke)
              if (ke.getKeyCode() == KeyEvent.VK_TAB)
                   ke.consume();
                   KeyboardFocusManager.getCurrentKeyboardFocusManager()
                             .focusNextComponent();
                   return;
              if (ke.getKeyCode() == KeyEvent.VK_TAB && ke.isShiftDown())
                   ke.consume();
                   KeyboardFocusManager.getCurrentKeyboardFocusManager()
                             .focusPreviousComponent();
                   return;
              if ((lastKeyCode == KeyEvent.CTRL_DOWN_MASK) &&
                        (ke.getKeyCode() == KeyEvent.VK_ENTER))
                   ke.consume();
                   editorComponent.requestFocus();
              else
                   lastKeyCode = ke.getKeyCode();
         public void keyReleased(KeyEvent ke)
              // TODO Auto-generated method stub
         }

  • Problem using an editable JComboBox as JTable cell editor

    Hi,
    i have a problem using an editable JComboBox as cell editor in a JTable.
    When i edit the combo and then I press the TAB or ENTER key then all works fine and the value in the TableModel is updated with the edited one, but if i leave the cell with the mouse then the value is not passed to the TableModel. Why ? Is there a way to solve this problem ?
    Regards
    sergio sette

    if (v1.4) [url
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JTa
    le.html#setSurrendersFocusOnKeystroke(boolean)]go
    hereelse [url
    http://forum.java.sun.com/thread.jsp?forum=57&thread=43
    440]go here
    Thank you. I've also found this one (the first reply): http://forum.java.sun.com/thread.jsp?forum=57&thread=124361 Works fine for me.
    Regards
    sergio sette

  • How to use Jtable cell Editor

    HI,
    Here trying to populate the ImageIcon using JLabel in Jtable cell. For that I used DefaultCellRenderer. For implement the mouseListener to label I used the DefaultCellEditor. I am facing one problem here. After editing the label I selected the second row of the table, the first row image is not displaying. Can any one help on this issue?
    public class LabelCellEditor extends DefaultCellEditor {
    public LabelCellEditor(final JCheckBox checkBox) {
    super(checkBox);
    public Component getTableCellEditorComponent(final JTable table, final Object value,
    final boolean isSelected, final int row, final int column) {
    Color background = null;
    background = ColorManager.SELECTED_ROW_BGCOLOR;
    labelVal = (JLabel) value;
    labelVal.setOpaque(true);
    labelVal.setFont(FontManager.TABLE_DATA_FONT);
    labelVal.setBackground(background);
    labelPanel = new JPanel();
    labelPanel.setOpaque(true);
    labelPanel.setBackground(background);
    labelPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    labelPanel.setBorder(new EmptyBorder(5, 0, 0, 0));
    labelPanel.add(labelVal);
    return this.labelPanel;
    public Object getCellEditorValue() {
    return this.labelPanel;
    public class LabelCellRenderer extends DefaultTableCellRenderer {
    public LabelCellRenderer(final int alignment) {
    //setHorizontalAlignment(alignment);
    this.align = alignment;
    public Component getTableCellRendererComponent(final JTable table, final Object value,
    final boolean isSelected, final boolean hasFocus, final int row, final int column) {
    if (value != null) {
    if (value instanceof JLabel) {
    labelVal = (JLabel) value;
    labelVal.setOpaque(true);
    labelVal.setFont(FontManager.TABLE_DATA_FONT);
    labelVal.setBackground(background);
    labelVal.setHorizontalAlignment(this.align);
    labelVal.setBorder(new EmptyBorder(0, LRPADD, 0, LRPADD));
    JPanel panel = new JPanel();
    panel.setOpaque(true);
    panel.setBackground(background);
    panel.setLayout(new FlowLayout(FlowLayout.LEFT));
    panel.setBorder(new EmptyBorder(5, 0, 0, 0));
    panel.add(labelVal);
    return panel;
    return this;
    }

    With more than 30 postings you should know by now how to use the "Code" tags when posting code so the code reatains its original formatting and is therefore more readable.
    There is no need to create a custom editor, here is a simple example.

  • Really stuck with iPad mini since iOS7 download

    I downloaded iOS7 onto my iPad mini last night, when I woke up this morning the passcode no longer worked. I cannot get into the iPad to shek the IMEI number (something Apple don't seem to be able to talk to me without), I didn't set up the mini by syncing to a mac and cannot seem to restore either. This is really frustrating as it actually feels as though it's Apple's fault...can any one help me resolve this? I tried the emergency restore through itunes but stops halfway through to say it cannot complete restore to a passcode restricted device...I really am stuck

    Hi dataman.co.uk,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    Click on the link to see more details and screenshots. 
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/HT1212?viewlocale=en_US
    If you have never synced your device with iTunes, or you do not have access to a computer
    If you see one of following alerts, you need to erase the device:
    "iTunes could not connect to the [device] because it is locked with a passcode. You must enter your passcode on the [device] before it can be used with iTunes."
    "You haven't chosen to have [device] trust this computer"
    If you have Find My iPhone enabled, you can use Remote Wipe to erase the contents of your device. If you have been using iCloud to back up, you may be able to restore the most recent backup to reset the passcode after the device has been erased.
    Alternatively, place the device in recovery mode and restore it to erase the device:
    Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to shut down.
    While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    Continue holding the Home button until you see the Connect to iTunes screen.
    iTunes will alert you that it has detected a device in recovery mode. Click OK, and then restore the device.
    Cheers,
    - Judy

  • Really stuck with multipart message...

    I post below the essence of my code... I read a lot of pages on the internet but my multipart message doesn't want to work :
    With Outlook the mailer says that the encoding is unsupported and it attaches the multipart as a text file...
    In outlook express the message is ok but the images used as datasources are attached a second time, as regular files. I have checked everything several times...
    Thanks for any hint, I lost my day :-(
    I use javamail API 1.3, jaf 1.0.2, jdk 1.3.1
    I have an ArrayList for the datasources, one for their headers, another one for the urls to the fiels to attach and a last one for the file names. I have 3 datasources (gif images) and 2 attachments (xml and pdf). The multipart message code is snipped at the bottom.
    Barbara
    // creates mail session and mime message
    this.mailSession = javax.mail.Session.getDefaultInstance(this.props, null);
    this.msg = new MimeMessage(mailSession);
    MimeBodyPart mbp1 = new MimeBodyPart();
    Multipart mmp = new MimeMultipart();
    //set from, to and cc fields ok
    try{
    this.msg.setSubject(this.subject,this.mimeCharSet);
    this.msg.setSentDate(new java.util.Date());
    catch(Exception e){}
    // html ?
    try{
    if(html){
    mbp1.setContent(this.body,"text/html");
    mbp1.addHeaderLine("Content-Type: text/html;charset=" + this.mimeCharSet +"\"");
    mbp1.addHeaderLine("Content-Transfer-Encoding: quoted-printable");
    else{
    mbp1.setContent(this.body, "text/plain");
    mbp1.addHeaderLine("Content-Type: text/plain;charset=" + this.mimeCharSet +"\"");
    mbp1.addHeaderLine("Content-Transfer-Encoding: 8bit");
    mmp.addBodyPart(mbp1);
    catch(Exception e){System.out.println("bug with content : " + e);}
    // datasources and headers
    try{
    if(this.dataSources != null){
    for(int j=0;j < this.dataSources.size();j++){
    BodyPart mbp2 = new MimeBodyPart();
    javax.activation.DataSource aSource = new URLDataSource(new URL((String) this.dataSources.get(j)));
    mbp2.setDataHandler(new DataHandler(aSource));
    mbp2.setHeader("Content-ID",(String) dsHeaders.get(j));
    System.out.println("added datasource : " + this.dataSources.get(j));
    mmp.addBodyPart(mbp2);
    catch(Exception e){
    System.out.println("bug with add datasources " + e);
    // other attachments
    try{
    if(this.file != null){
    for(int j=0;j < this.file.size();j++){
    BodyPart mbp2 = new MimeBodyPart();
    javax.activation.DataSource aSource = new URLDataSource(new URL((String) this.file.get(j)));
    mbp2.setDataHandler(new DataHandler(aSource));
    System.out.println("attached file : " + this.file.get(j));
    try{
    mbp2.setFileName((String) fileName.get(j));
    catch(Exception e){// no filename
    mmp.addBodyPart(mbp2);
    this.msg.setContent(mmp);
    catch(Exception e){
    System.out.println("bug with add files " + e);
    try{
    javax.mail.Transport.send(this.msg);
    catch(Exception e){
    System.out.println("send mail failed : " + e);
    Now the multipart message :
    Received: from <snip> with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21)
         id P63WS3KF; Mon, 9 Sep 2002 16:57:07 +0200
    Message-ID: <4650852.1031581670610.JavaMail.[snip]>
    Date: Mon, 9 Sep 2002 16:27:49 +0200 (CEST)
    From: =?iso-8859-1?Q?Barbara=A0Post?= <[snip]>
    To: <snip>
    Subject: Some subject
    Mime-Version: 1.0
    Content-Type: multipart/mixed; boundary="----=_Part_0_8194658.1031581669238"
    ------=_Part_0_8194658.1031581669238
    Content-Type: text/html;charset=iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <snip of html code>
    ------=_Part_0_8194658.1031581669238
    Content-Type: image/gif
    Content-Transfer-Encoding: base64
    Content-ID: 69zzz@pc01
    <snip of first included image code>
    ------=_Part_0_8194658.1031581669238
    Content-Type: image/gif
    Content-Transfer-Encoding: base64
    Content-ID: 69zzz@pc00
    R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAQAICRAEAOw==
    ------=_Part_0_8194658.1031581669238
    Content-Type: image/gif
    Content-Transfer-Encoding: base64
    Content-ID: 69zzz@pc02
    <snip of third included image code>
    ------=_Part_0_8194658.1031581669238
    Content-Type: text/xml; name=nop41.xml; charset=Cp1252
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: attachment; filename=nop41.xml
    <snip of xml attachement code>
    ------=_Part_0_8194658.1031581669238
    Content-Type: application/pdf; name=nop41lt.pdf
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename=nop41lt.pdf
    <snip of pdf attachement code>
    ------=_Part_0_8194658.1031581669238--

    Basic message structure required is
    *{HEADERS}
    *{MULTIPART MIME MESSAGE (RELATED)}
    *>>>{PART 1 MULTIPART PART (ALTERNATIVE)}
    *>>>>>>{PLAIN TEXT PART}
    *>>>>>>{HTML TEXT PART}
    *>>>{END PART 1 MULTIPART PART (ALTERNATIVE)}
    *>>>{PART 2 INLINE IMAGE FILE (GIF/JPEG etc}
    *>>>......
    *>>>{PART n     }
    *{END MULTIPART MIME MESSAGE (RELATED}
    Snippet of code I use, but be aware all the html references to images etc are converted to cid:xxxxxxxxxxxx format outside of this code. No point in sending the image in the message if you refer to it by a url like http://www.foo.org/image1.gif
    SH
    <Code Snippet>
    // create a message
    msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(from));
    msg.setSubject(subject);
    // create and fill the first message part with the Title and plain text
    MimeBodyPart mbpa1 = new MimeBodyPart();
    mbpa1.setText(ho.getTitle() + "\n" + ho.getText());
    mbpa1.addHeaderLine("Content-Type: text/plain; charset=\"iso-8859-1\"");
    mbpa1.addHeaderLine("Content-Transfer-Encoding: quoted-printable");
    // Create and fill the second message part with the HTML code
    MimeBodyPart mbpa2 = new MimeBodyPart();
    mbpa2.setText(ho.getHTMLCode());
    mbpa2.addHeaderLine("Content-Type: text/html; charset=\"iso-8859-1\"");
    mbpa2.addHeaderLine("Content-Transfer-Encoding: quoted-printable");
    // create the Multipart and its parts to it
    Multipart mp = new MimeMultipart("related");
    Multipart mp2 = new MimeMultipart("alternative");
    mp2.addBodyPart(mbpa1);
    mp2.addBodyPart(mbpa2);
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setContent(mp2);
    mp.addBodyPart(mbp1);
    if (inline) {
    // Enumerate the Image Names and add them to the message
    for (Enumeration e = ho.getImageNames(); e.hasMoreElements();) {
    String str = e.nextElement().toString();
    MimeBodyPart mpi;
    URL url2;
    String fullStr = ho.getImageUrl(str);
    if (inlineAll || ho.isImageLocal(fullStr)) {
    if (debug)
    System.out.println("Adding: " + fullStr);
    url2 = new URL(fullStr);
    mpi = new MimeBodyPart();
    URLDataSource fds2 = new URLDataSource(url2);
    mpi.setDataHandler(new DataHandler(fds2));
    // mpi.addHeaderLine("Content-Location: " + fullStr);
    if (ho.getCidValue(str).length() > 0)
    mpi.setHeader("Content-ID", ho.getCidValue(str));
    mp.addBodyPart(mpi);
    // add the Multipart to the message
    msg.setContent(mp);
    // set the Date: header note that the java.sql package also defines date
    msg.setSentDate(new java.util.Date());
    </Code Snippet>

  • Really stuck with speeding up and slowing down clips

    Hi gang,
    I have been reading the Final Cut manual for the last hour and fooling around with my clips, but I can't get the effect that I want.
    I have a clip (CGI of a star field moving towards the observer) that I want initially to be frozen, then I want the clip to accelerate rapidly, and then end at about double normal speed. I thought I would be able to use keyframes and specify the playback rate at given points, but that option doesn't seem to exist. I have been playing with variable and constant speed settings, but these don't seem to work either.
    Ideally, the clip would go like this:
    1) first frame of original footage is frozen for 2 seconds.
    2) the original footage then begins playing, accelerating rapidly from frozen to double speed over 2 seconds.
    3) remainder of original footage plays at double speed until complete.
    I feel like I am missing something obvious, but I can't get it to work!
    Any suggestions appreciated.
    Cheers!

    Dude, I have the same problem. I found a picture/text tutorial on how to slow down, speed up and reverse all in one clip w/o chopping it up, but it was for FCP 4. I have 5 and when I ramp the green line down it speeds up, doesn't slow down. Is it just me or is the effect changed from FC4 to FC5.
    I'm looking for a great video tutorial for FC5 or similar on how to slow, speed up and reverse a clip using the Time Remap Tool in FC.
    If it's a DVD I have to buy so be it.
    Thanks everyone.

  • History links no longer auto-open when selected. Running 33.0 (beta channel); is there a known fix, or am I stuck with troubleshoot using safe mode? :\ Tnx!

    Additional: I've searched about:config but can't find a setting that would appear to apply. Am I missing something?

    Extensions:
    * LastPass Plugin
    * Shockwave Flash 15.0 r0
    * Adobe PDF Plug-In For Firefox and Netscape 11.0.9
    * Google Update
    * iTunes Detector Plug-in
    * Next Generation Java Plug-in 10.55.2 for Mozilla browsers
    * NPRuntime Script Plug-in Library for Java(TM) Deploy
    * The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    * 5.1.30214.0
    * Garmin Communicator Plug-In 4.1.0.0
    * Citrix Online App Detector Plugin
    * Adobe Shockwave for Director Netscape plug-in, version 12.0.4.144
    * ActiveTouch General Plugin Container Version 105
    * Amazon MP3 Downloader Plugin 1.0.17
    * NPWLPG
    * The plug-in allows you to open and edit files using Microsoft Office applications
    * Office Authorization plug-in for NPAPI browsers

  • Am I really stuck with OS4 on my 3G?

    After updating to version 4, my phone is so slow, it's unusable. Does anyone know of an "apple Approved" way for me to go back to 3.x?
    Thanks!

    Mine has become slow, apps keep crashing, even after re-installing them, the phone does some really odd things, I will select one app and sometimes another will open?--this is wierd! I have already re-installed os4 incase it was an error during the original install but it is the same! My wi-fi signal is weak now, even when i sit next to my router. I HATE OS4

  • Stuck with problem using waitFor()

    Hi,
    I wrote a program which will run in a loop like this
    for(int i=0;i<theme_caseidVec.size();i++)
    String proj_theme="",proj_case_id="",repository_name ="";
    String[] Details=new String[2];
    Details=(String[])theme_caseidVec.get(i);
    proj_theme = Details[0];
    proj_case_id = Details[1];
    repository_name = (String)CVSRepoHash.get(proj_theme);
    path = properties.getProperty(proj_case_id);
    if(proj_theme!= null && proj_case_id!= null && repository_name!= null && !repository_name.equals("0") && path!= null)
    System.out.println("repository_name: "+repository_name+"proj_theme: "+proj_theme+"proj_case_id :"+proj_case_id);
    res = checkoutByProj(repository_name,proj_theme,path);
    and i will be invoking the following method each time for more than 200 times.
    public synchronized int checkoutByProj(String repository_name,String proj_theme,String proj_path)
    String cmd = "";
    int i=0;
    cmd = "bash /home/abc/cvsCheckoutProj.sh ";
    cmd = cmd.concat(repository_name.trim());
    cmd = cmd.concat(" ");
    cmd = cmd.concat(proj_theme.trim());
    cmd = cmd.concat(" ");
    cmd = cmd.concat(proj_path.trim());
    File workDir = new File("/home/abc");
    try
    System.out.println("Command:" + cmd);
    Process p = Runtime.getRuntime().exec(cmd, null, workDir);
    i = p.waitFor();
    catch(Exception e)
    System.out.println(e);
    cmd = "";
    return i;
    But i am not able to fully execute this code till the end.
    Its geting hanged and nothing is displayed in the console.
    Can any one suggest me the solution for this problem.

    String[] cmd = {"bash", "-c", "/home/abc/cvsCheckoutProj.sh", repository_name.trim()), proj_theme.trim(), proj_path.trim()};
    File workDir = new File("/home/abc");
    Process p = Runtime.getRuntime().exec(cmd, null, workDir);Make sure you handle the Process stdout and stderr as recommended in http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html .

  • Capturing JCheckBox edit from within a JTable cell

    Hey,
    I've gone through as many posts as i can from this forum and i have managed to understand quite a bit but there is just this one probelm that i have.
    What i have is a checkbox in a cell in a jtable that causes the a jpanel elsewhere to repaint in various ways depending on whether the checkbok is checked or not.
    The code below is for the table editor. The model is my table model. aCanvas is the panel being repainted. completeVisible is the array that aCanvas accesses to repaint the panel.
    The code below works perfectly after the but only after the second click. the first 2 times i click the checkbox the value printed is true and then afterwards it starts alternating and working correctly... can anyone please tell me why this is?
    thanks in andvance... :o)
    private class TSPCellEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
              Boolean visible;
              JCheckBox check;
              String TEST = "TEST";
              public TSPCellEditor() {
                   check = new JCheckBox();
                   check.setActionCommand(TEST);
                   check.addActionListener(this);
              public void actionPerformed(ActionEvent e) {
                   if(TEST.equals(e.getActionCommand())) {
                        visible = new Boolean(check.isSelected());
                        fireEditingStopped();
              public Object getCellEditorValue() {
                   return visible;
              public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
                   visible = (Boolean)(value);
                   //boolean temp = visible.booleanValue();
                   //temp = !temp;
                   //visible = Boolean.valueOf(temp);
                   check.setSelected(visible.booleanValue());
    System.out.println(completeVisible[row]+" "+row);               
                   completeVisible[row] = visible.booleanValue();
                   model.setValueAt(visible, row, column);
                   aCanvas.repaint();
                   return check;
         }

    I can't answer your question, but I think a better way to implement your solution is to use a TableModelListener. An event is fired whenver the contents of the table model are changed so you can do your processing here. This [url http://forum.java.sun.com/thread.jsp?forum=57&thread=418560]thread gives a simple example.

  • How can I use JTextField as JTable cell editor while using AbstractTableMod

    I use this code but can not edit field
    import javax.swing.table.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.text.*;
    public class Main extends JFrame {
    JTable table;
    MyTableModel tableModel;
    public Main() {
    super("Colored JTable Demonstration");
    tableModel = new MyTableModel(10, 5);
    table = new JTable(tableModel);
    DefaultTableCellRenderer colorRenderer = new DefaultTableCellRenderer() {
    public void setValue(Object value) {
    if (value instanceof ColoredItem) {
    Color fcolor = ((ColoredItem) value).getForeground();
    Color bcolor = ((ColoredItem) value).getBackground();
    this.setForeground(fcolor);
    this.setBackground(bcolor);
    setText(((ColoredItem) value).getValue());
    table.setDefaultRenderer(Object.class, colorRenderer);
    //table.setDefaultEditor(Object.class, new DefaultCellEditor(new JTextField()));
    //Set up real input validation for the integer column.
    TableCellEditor editor = new DefaultCellEditor(new JTextField()) {
    public Component getTableCellEditorComponent(JTable table,
    Object value, boolean isSelected, int row, int column) {
    super.getTableCellEditorComponent(table, value, isSelected,row, column);
    JTextField myField = (JTextField) getComponent();
    //myField.setDocument(new ValidDocument());
    return myField;
    //if(value==null) return null;
    //return null;
    int numbercolumn = table.getColumnCount();
    for(int i = 0; i< numbercolumn ; i++){
    table.getColumnModel().getColumn(i).setCellEditor(editor);
    // table.getColumnModel().getColumn(i).setCellRenderer(new ColorRenderer());
    //table.validate();
    JScrollPane scrollPane = new JScrollPane(table);
    getContentPane().add(scrollPane, BorderLayout.CENTER);
    JPanel radioPanel = new JPanel(new GridLayout(1, 5));
    JRadioButton redRadio = new JRadioButton("Red");
    JRadioButton greenRadio = new JRadioButton("Green");
    JRadioButton blueRadio = new JRadioButton("Blue");
    JRadioButton yellowRadio = new JRadioButton("Yellow");
    JRadioButton blackRadio = new JRadioButton("Black");
    // Group the radio buttons.
    ButtonGroup group = new ButtonGroup();
    group.add(redRadio);
    group.add(greenRadio);
    group.add(blueRadio);
    group.add(yellowRadio);
    group.add(blackRadio);
    radioPanel.add(redRadio);
    radioPanel.add(greenRadio);
    radioPanel.add(blueRadio);
    radioPanel.add(yellowRadio);
    radioPanel.add(blackRadio);
    RadioListener radioListener = new RadioListener();
    redRadio.addActionListener(radioListener);
    greenRadio.addActionListener(radioListener);
    blueRadio.addActionListener(radioListener);
    yellowRadio.addActionListener(radioListener);
    blackRadio.addActionListener(radioListener);
    // add radiopanel to container
    JPanel panel = new JPanel(new GridLayout(2, 1));
    panel.add(new JLabel("Select color for selected cell:"));
    panel.add(radioPanel);
    getContentPane().add(BorderLayout.SOUTH, panel);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    class ValidDocument extends PlainDocument {
    public void insertString(int index, String s, AttributeSet a)
    throws BadLocationException {
    if ((s == null) || (s.length() == 0)) {
    return;
    StringBuffer t = new StringBuffer(getLength() + s.length());
    t.append(getText(0, index));
    t.append(s);
    t.append(getText(index, getLength() - index));
    if(s.equals("1") && t.toString().equals("1")){               
    super.insertString(index, s, a);
    if(s.equals("0") && t.toString().equals("0")){
    super.insertString(index, s, a);
    if(s.equals(".") && t.toString().equals("0.")){
    super.insertString(index, s, a);
    if(s.equals("5") && t.toString().equals("0.5")){
    super.insertString(index, s, a);
    if(s.equals("b") && t.toString().equals("b")){
    super.insertString(index, s, a);
    //if (super instanceof ColoredItem) {
    // Color fcolor = ((ColoredItem) value).getForeground();
    // Color bcolor = ((ColoredItem) value).getBackground();
    // this.setForeground(fcolor);
    // this.setBackground(bcolor);
    //super.setText(t.toString());
    System.out.println("hehe");
    class RadioListener implements ActionListener {
    public void actionPerformed(ActionEvent ae) {
    int row = table.getSelectedRow();
    int column = table.getSelectedColumn();
    ColoredItem ci = (ColoredItem) tableModel.getValueAt(row, column);
    if (ae.getActionCommand().equals("Red"))
    ci.setBackground(Color.red);
    else if (ae.getActionCommand().equals("Green"))
    ci.setBackground(Color.green);
    else if (ae.getActionCommand().equals("Blue"))
    ci.setBackground(Color.blue);
    else if (ae.getActionCommand().equals("Yellow"))
    ci.setBackground(Color.yellow);
    else if (ae.getActionCommand().equals("Black"))
    ci.setBackground(Color.black);
    System.out.println(ci.getValue());
    // necessary to cause a fireTableCellUpdated event
    tableModel.setValueAt(ci, row, column);
    private class ColoredItem {
    private String value;
    private Color foreground;
    private Color background;
    public ColoredItem(String value, Color foreground, Color background) {
    this.value = value;
    this.foreground = foreground;
    this.background = background;
    public void setValue(String value) {
    this.value = value;
    public void setForeground(Color foreground) {
    this.foreground = foreground;
    public void setBackground(Color background) {
    this.background = background;
    public String getValue() {
    return value;
    public Color getForeground() {
    return foreground;
    public Color getBackground() {
    return background;
    class MyTableModel extends AbstractTableModel {
    String [] columnNames;
    ColoredItem [][] data;
    MyTableModel(int rows, int columns) {
    columnNames = createColumnElements(columns);
    data = createTableElements(rows, columns);
    public int getColumnCount() {
    return columnNames.length;
    public int getRowCount() {
    return data.length;
    public String getColumnName(int col) {
    return columnNames[col];
    public Object getValueAt(int row, int col) {
    return data[row][col];
    public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
    public void setValueAt(ColoredItem value, int row, int col) {              
    data[row][col] = value;
    //System.out.println((ColoredItem)value.getValue());
    //temp.setValue((ColoredItem)value.getValue());
    fireTableCellUpdated(row, col);
    private String[] createColumnElements(int columns) {
    String[] data;
    data = new String[columns];
    for (int i=0; i<columns; i++) {
    data[i] = new String("Column " + i);
    return data;
    private ColoredItem [][] createTableElements(int rows, int columns) {
    ColoredItem [][]data;
    data = new ColoredItem[rows][];
    for (int i=0; i<rows; i++) {
    data[i] = new ColoredItem[columns];
    for (int j=0; j<columns; j++) {
    data[i][j] = new ColoredItem("", Color.black, Color.white);
    return data;
    public boolean isCellEditable(int rowIndex, int columnIndex) {
    return true;
    public static void main(String []args) {
    Main main = new Main();
    main.pack();
    main.setVisible(true);
    }

    JTextField jtxf=new JTextField();
         private void setColumns() {
    TableColumn column = null;
    if(this.getRowCount()>0){
    for (int i = 0; i < this.getColumnCount(); i++) {
    column = this.getColumnModel().getColumn(i);
              DefaultCellEditor dce = new DefaultCellEditor(jtxf);
              column.setCellEditor(dce);
              dce.setClickCountToStart(1);
    simply call this method in constructor it will help u

  • I need to switch a 12V relay using USB6211.i am stuck with programming

    i need to switch a 12V relay using USB6211.i am stuck with programming  using daq assistant. i am doing hardware implementation also..can anyone give some help...

    You can create tasks with individual lines and ports and then have multiple tasks all running for the same device.  I would highly recommend the DAQmx VI API.  It gives a little better control and is easier to see exactly what is happening.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Got myself stuck with css

    I've gotten myself really stuck with my css layout. I've
    basically followed a couple of different tutorials to get where I
    am. if you'll visit
    http://eliteportraits.com/teetest/
    you can see the effort so far. Where i'm stuck is the main content
    block. I read different things on nesting div tags and can't figure
    out how to do this with or without nested tags. I basically want a
    white background for everything under the purple menu bar (I'd also
    like that bar to extend to the edge of the top rounded white
    graphic.). I ca't seem to make it work. what am I screwing
    up/missing? is there a tutorial somewhere that can help? This is
    the last thing I've got to figure out before I can finally move
    forward. thanks so much for any help.
    Mark

    eliteportraits wrote:
    > If you look to the logo on top of the page (above the
    purple bar), there's
    > text immediately to the right of the logo that says
    "some menu links here, like
    > shopping cart and such" - I would like that line of text
    to sit on top of the
    > purple bar (about 10px above the purple bar) and be
    aligned to the right edge
    > of the page. right now the text is aligned with the top
    of the image.
    Then you need to put that line of text in its own container,
    a <div> <p>
    <h> whatever. Lets just use another <div> for
    now. Insert the new <div>
    in your pages code, right after your logo image (see below)
    <div id="top">
    <img src="tutorial_files/logo.jpg">
    <div id="topRight">some menu links here, like shopping
    cart and
    such</div><!-- end topRight -->
    </div><!-- end top -->
    Then use some css to style/position the new <div>
    #topRight {
    float: right;
    width: 350px;
    text-align: right;
    padding-top: 65px;
    Back-tracking on what I said yesterday about
    relative/absolute
    positioning you could also make the 'top' <div> have a
    position of
    relative and then the 'topRight' <div> a position of
    absolute to place
    it in the position required.
    #top {
    position: relative;
    #topRight {
    position: absolute;
    top: 85px;
    right: 0;
    width: 350px;
    text-align: right;
    This is one of the only times you should need to use relative
    positioning on a container i.e., when you require an
    absolutely
    positioned element to sit within it. However if there is an
    alternative
    way of achieving the same results then personally I would
    always use
    that method in preference. Many beginners just use relative
    positioning
    all over the place without really understanding what they are
    doing. Not
    all, but in the majority of cases, it is not required.
    Don't be afraid to experiment with css to see what results
    can be
    achieved using various combinations. Once you grasp the
    basics then the
    rest will fall into place quite quickly.
    The key is to think boxes being positioned by using
    margin/padding.
    Where people go wrong is they tend to use too many boxes
    which results
    in too many elements to keep track of or just plain don't do
    the maths
    needed to make css work.
    Always comment the end of a container </div><!-- end
    header --> or you
    can put the comment inside the closing tag <!-- end header
    --></div>
    This will make it easier to identify them when the page gets
    more complex.

  • Acer getting heat with basic use

    Hi
    I got Acer aspire 5741G
    I5 -430m
    nvidia geforce gt 320m
    3gb ram
    Linux localhost 3.9.6-1-ARCH #1 SMP PREEMPT Fri Jun 14 08:12:55 CEST 2013 x86_64 GNU/Linux
    [fluxbox]
    Okay my notebook is getting really hot with basic use(web browser[i am trying to avoid flash] + sometimes netbeans), I even bought cooler pad, but its still hot, I can feel this on touchpad ;/
    I am using novaeu driver 304,
    I got freqcpu deamon,
    I  have installed laptop-mode-tools
    What could be an issue which make my laptop hot ?
    I reject hardware problems, because on windows it was cold
    Thanks !
    I really like arch, but I am worried about my notebook

    Hey chosen,
    You may also want to check if your discrete graphics card is powered on. This was my problem when my laptop was running too hot. If you're performing light GPU work, then it should be safe to turn off your discrete card (saving battery and cooling down your machine).
    If you have nouveau still installed you can try -
    Switchable Graphics
    First mount debugfs for switch access:
    # mount -t debugfs debugfs /sys/kernel/debug
    Make sure nouveau is loaded:
    # modprobe nouveau
    Now you may use the following commands:
    #Check current status:
    cat /sys/kernel/debug/vgaswitcheroo/switch
    #Enable NVIDIA - requires you to re-login to X
    echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
    #Enable Intel - requires you to re-login to X
    echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
    #Power off unused card
    echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
    #Power on unused card
    echo ON > /sys/kernel/debug/vgaswitcheroo/switch
    The above was copied nearly verbatim from:
    https://wiki.archlinux.org/index.php/Ac … e_Graphics
    In my case I was never able to switch to my discrete card, only power it off.
    You may also want to look at bumblebee for your graphic needs : https://wiki.archlinux.org/index.php/Bumblebee
    /edit Found this too: https://bbs.archlinux.org/viewtopic.php … 4#p1241464
    Last edited by deca (2013-07-01 07:54:27)

Maybe you are looking for

  • Multiple table of contents in document

    Hi there, I'm new in FM8. I recently received a document in FM8. The structure of the document is as follows: Every file of the document corresponds to a chapter. Each chapter contains a table of contents for its subheaders and paragraphs. Table of c

  • What is import statement for ?

    Hi all, Sorry for asking a silly question. Since it is a new to java forum I am asking this. What is happening when an import statement is triggered at compile time and at runtime. What is the difference/advantages/disadvantages between importing an

  • Database Version Compatibility

    What is the earliest version of the Oracle Database which is supported by Oracle 9ias. Regards Stephanie Farrugia.

  • Word won't save revised document.

    Tried Command S and regular Save As.  When I print, the added text doesn't appear on  the preview or the printed copy.  Any help for this? I'm working on a MacBook Pro with newly installed Microsoft Word and a saved document from my old PC.

  • DAC load failed.

    Hi, Ours is still BI 10g with DAC 7.9.6. We have a execution plan scheduled which extracts data from source files to load staging thru informatica and eventually final target tables.  On holidays there is no business done, so NO input file is sent...