Problem with addRow and MultiLine Cell renderer

Hi ,
Ive a problem with no solution to me .......
Ive seen in the forum and Ivent found an answer.......
The problem is this:
Ive a JTable with a custom model and I use a custom multiline cell renderer.
(becuse in the real application "way" hasnt static lenght)
When I add the first row all seem to be ok.....
when I try to add more row I obtain :
java.lang.ArrayIndexOutOfBoundsException: 1
at javax.swing.SizeSequence.insertEntries(SizeSequence.java:332)
at javax.swing.JTable.tableRowsInserted(JTable.java:2926)
at javax.swing.JTable.tableChanged(JTable.java:2858)
at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableMo
del.java:280)
at javax.swing.table.AbstractTableModel.fireTableRowsInserted(AbstractTa
bleModel.java:215)
at TableDemo$MyTableModel.addRow(TableDemo.java:103)
at TableDemo$2.actionPerformed(TableDemo.java:256)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
64)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1817)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5134)
at java.awt.Component.processEvent(Component.java:4931)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3639)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1590)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
This seems to be caused by
table.setRowHeight(row,(getPreferredSize().height+2)); (line 164 of my example code)
About the model I think its ok.....but who knows :-(......
Please HELP me in anyway!!!
Example code :
import javax.swing.*;
import javax.swing.table.*;
import java.text.*;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class TableDemo extends JFrame {
private boolean DEBUG = true;
MyTableModel myModel = new MyTableModel();
MyTable table = new MyTable(myModel);
int i=0;
public TableDemo() {
super("TableDemo");
JButton bottone = new JButton("Aggiungi 1 elemento");
table.setPreferredScrollableViewportSize(new Dimension(500, 70));
//table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
//Create the scroll pane and add the table to it.
JScrollPane scrollPane = new JScrollPane(table);
//Add the scroll pane to this window.
getContentPane().add(bottone,BorderLayout.NORTH);
getContentPane().add(scrollPane, BorderLayout.CENTER);
bottone.addActionListener(Add_Action);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
class MyTable extends JTable {
MultiLineCellRenderer multiRenderer=new MultiLineCellRenderer();
MyTable(TableModel tm)
super(tm);
public TableCellRenderer getCellRenderer(int row,int col) {
          if (col==1) return multiRenderer;
          else return super.getCellRenderer(row,col);
class MyTableModel extends AbstractTableModel {
Vector data=new Vector();
final String[] columnNames = {"Name",
"Way",
"DeadLine (ms)"
public int getColumnCount() { return 3; }
public int getRowCount() { return data.size(); }
public Object getValueAt(int row, int col) {
Vector rowdata=(Vector)data.get(row);
                                                            return rowdata.get(col); }
public String getColumnName(int col) {
return columnNames[col];
public void setValueAt (Object value, int row,int col)
     //setto i dati della modifica
Vector actrow=(Vector)data.get(row);
actrow.set(col,value);
     this.fireTableCellUpdated(row,col);
     public Class getColumnClass(int c)
          return this.getValueAt(0,c).getClass();
     public boolean isCellEditable(int row, int col) {
//Note that the data/cell address is constant,
//no matter where the cell appears onscreen.
if (col == 1)
return false;
else
return true;
public void addRow (String name,ArrayList path,Double dead) {
     Vector row =new Vector();
     row.add(name);
     row.add(path);
     row.add(dead);
     row.add(name); //!!!Mi tengo questo dato da utilizzare come key per andare a
     //prendere il path nella lista dei paths di Project
     //(needed as key to retrive data if name in col. 1 is changed)
     data.add(row);
     //Inspector.inspect(this);
     System.out.println ("Before firing Adding row...."+this.getRowCount());
     this.fireTableRowsInserted(this.getRowCount(),this.getRowCount());
public void delRow (String namekey)
for (int i=0;i<this.getRowCount();i++)
if (namekey.equals(this.getValueAt(i,3)))
data.remove(i);
this.fireTableRowsDeleted(i,i);
//per uscire dal ciclo
i=this.getRowCount();
public void delAllRows()
int i;
int bound =this.getRowCount();     
for (i=0;i<bound;i++)     
     {data.remove(0);
     System.out.println ("Deleting .."+data);
this.fireTableRowsDeleted(0,i);          
class MultiLineCellRenderer extends JTextArea implements TableCellRenderer {
private Hashtable rowHeights=new Hashtable();
public MultiLineCellRenderer() {
setEditable(false);
setLineWrap(true);
setWrapStyleWord(true);
//this.setBorder(new Border(
public Component getTableCellRendererComponent(JTable table,Object value,                              boolean isSelected, boolean hasFocus, int row, int column) {
//System.out.println ("Renderer called"+value.getClass());
if (value instanceof ArrayList) {
String way=new String     (value.toString());
setText(way);
TableColumn thiscol=table.getColumn("Way");
//System.out.println ("thiscol :"+thiscol.getPreferredWidth());
//setto il size della JTextarea sulle dimensioni della colonna
//per quanto riguarda il widht e su quelle ottenute da screen per l'height
this.setSize(thiscol.getPreferredWidth(),this.getPreferredSize().height);
// set the table's row height, if necessary
//System.out.println ("Valore getPreferred.height"+getPreferredSize().height);
     if (table.getRowHeight(row)!=(this.getPreferredSize().height+2))
     {System.out.println ("Setting Row :"+row);
         System.out.println ("Dimension"+(getPreferredSize().height+2));
         System.out.println ("There are "+table.getRowCount()+"rows in the table ");
         if (row<table.getRowCount())
         table.setRowHeight(row,(getPreferredSize().height+2));
else
setText("");
return this;
/**Custom JTextField Subclass che permette all'utente di immettere solo numeri
class WholeNumberField extends JTextField {
private Toolkit toolkit;
private NumberFormat integerFormatter;
public WholeNumberField(int value, int columns) {
super(columns);
toolkit = Toolkit.getDefaultToolkit();
integerFormatter = NumberFormat.getNumberInstance(Locale.US);
integerFormatter.setParseIntegerOnly(true);
setValue(value);
public int getValue() {
int retVal = 0;
try {
retVal = integerFormatter.parse(getText()).intValue();
} catch (ParseException e) {
// This should never happen because insertString allows
// only properly formatted data to get in the field.
toolkit.beep();
return retVal;
public void setValue(int value) {
setText(integerFormatter.format(value));
protected Document createDefaultModel() {
return new WholeNumberDocument();
protected class WholeNumberDocument extends PlainDocument {
public void insertString(int offs,
String str,
AttributeSet a)
throws BadLocationException {
char[] source = str.toCharArray();
char[] result = new char[source.length];
int j = 0;
for (int i = 0; i < result.length; i++) {
if (Character.isDigit(source))
result[j++] = source[i];
else {
toolkit.beep();
System.err.println("insertString: " + source[i]);
super.insertString(offs, new String(result, 0, j), a);
ActionListener Add_Action = new ActionListener() {
          public void actionPerformed (ActionEvent e)
          System.out.println ("Adding");
          ArrayList way =new ArrayList();
          way.add(new String("Uno"));
          way.add(new String("Due"));
          way.add(new String("Tre"));
          way.add(new String("Quattro"));
          myModel.addRow(new String("Nome"+i++),way,new Double(0));     
public static void main(String[] args) {
TableDemo frame = new TableDemo();
frame.pack();
frame.setVisible(true);

In the addRow method, change the line
this.fireTableRowsInserted(this.getRowCount(),this.getRowCount()); to
this.fireTableRowsInserted(data.size() - 1, data.size() - 1);Sai Pullabhotla

Similar Messages

  • Problem with CheckBox as table cell renderer

    i m making a JTable having three columns.
    i m also making a cellRenderer of my own MyRenderer
    extending Jcheckbox and implementing TableCellRenderer
    now i m setting MyRenderer as renderer for third column in my table and
    DefaultCellEditor with jcheckbox as parameter as cell editor for this column
    the code is like this--------------------
    ****making of JTable****
    table= new JTable(3,3);
    JScrollPane scrollPane = new JScrollPane(table);
    TableColumn tableColumn = table.getColumn("Male"); // let us suppose that this gives third column
    tableColumn.setCellRenderer(new MyRenderer ());
    tableColumn.setCellEditor(new DefaultCellEditor(new JCheckBox()));
    *****The classs implementing TableCellRenderer is given below******
    class MyRenderer extends JCheckBox implements TableCellRenderer{
    public MyRenderer(){
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus,
    int row, int column){
    if(value != null){
    Boolean booleanValue = (Boolean)value;
    setSelected(booleanValue.booleanValue());
    return this;
    ***********************************Problem****************************
    The problem is that when we click on the cell of that column first time,
    all the cells are selected.
    I don't want to use getColumnClass() method for this problem .
    If possible , please give some other solution.
    what is the problem behind this,If anybody can help us.
    Thanks in advance.

    I think the problem is, when the value is null the checkbox return with the selected state, b'coz u r
    returning the checkbox (as it is). so pl'z try with below code (ADDED).
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus,
    int row, int column){
    if(value != null){
    Boolean booleanValue = (Boolean)value;
    setSelected(booleanValue.booleanValue());
    else /// ADDED
    setSelected(false);/// ADDED
    return this;
    Nediaph.

  • JTable with JPanel form as cell renderer/editor

    I have a JTable that uses a custom cell editor/renderer. The cell editor/renderer is a JPanel form with labels and text panes. As the user edits the information, I adjust the table row height (setRowHeight) and the JPanel layout manager updates the layout on the cell editor. This all seems to work fine. However, when the user exists the cell and the cell renderer is shown, it has the correct new row height but has not been correctly layed-out for the new row height. How do I force my cell renderer to be re-layout after the editor closes?

    That does not seem to work. I have done the following:
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int r, int c)
    this.table = (EditorTable) table;
    row = r;
    column = c;
    if (isSelected)
    setBackground (Preferences.selectedRowBgColor);
    else
    setBackground (formBg);
    // constructs the panel components
    setCellValue (value);
    revalidate();
    return (this);

  • Problems with JSF and included subviews

    Hi everybody,
    I' ve got a problem with JSF and included subviews which makes me going
    crazy. I've got no clue why my web-pages are represent wrongly. The only
    tip I've got is that it must be connected with the kind I do include my JSF-pages.
    When I use <%@file="sub.jsp"%> my pages are are represent right. When I use <jsp:include page="Sub.jsp" /> or <c:import url="Sub.jsp" /> ( mark: the usage of flush="true" or flush="false" doesn't matter )
    my pages are represent wrongly.
    The usage of tags like f:facet or f:verbatim were also included but didn't point to an solution.
    I searched the whole Sun Developer Forum and some other web-sites for any solution for my problem but the given hints and clues didn't help. Now I'm trying to post my problem directly in Sun's Forum in hope to get help.
    My environment is the following:
    JAVA JDK 1.5 Update 4
    Tomcat 5.5.9
    JSLT 1.1
    Sun JSF 1.1
    Win 2K
    Here's my code:
    Main.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%
              String path = request.getContextPath();
              String basePath = request.getScheme() + "://" + request.getServerName()
                        + ":" + request.getServerPort() + path + "/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="<%=basePath%>">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <f:view>
              <h:form>
                   <div class="table">
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 1"/>
                             <h:outputText styleClass="tdinfo" value="value 2"/>
                        </div>
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 3"/>
                             <h:outputText styleClass="tdinfo" value="value 4"/>
                        </div>
                   </div>
              </h:form>     
              <jsp:include page="Sub.jsp" />
         </f:view>
    </body>
    </html>Sub.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <f:subview id="subview">
         <h:form>
              <div class="table">
                   <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 11"/>
                             <h:outputText styleClass="tdinfo" value="value 22"/>
                   </div>
                   <div class="tr">
                        <h:outputText styleClass="tdleft" value="value 33"/>
                        <h:outputText styleClass="tdinfo" value="value 44"/>
                   </div>
              </div>
         </h:form>
    </f:subview>stil.jsp
    <%@page contentType="text/css"%>
    <%
        String  schwarz     = "#000000",
                grau1       = "#707070",
                grau2       = "#c0c0c0",
                grau3       = "#e0e0e0",
                grau4       = "#e8e8e8",
                grau5       = "#fdfdfd",
                blau        = "#0000dd",
                tuerkis     = "#00cfff";
        String  liniendicke = "1px",
                linienart   = "solid";
        String allgemeineTextFarbe           = schwarz;
        String allgemeineHintergrundFarbe    = grau3;
        String infoTextFarbe                 = blau;
        String fieldsetRandFarbe             = blau;
        String fieldsetRandDicke             = liniendicke;
        String fieldsetRandArt               = linienart;
        String hrLinienFarbe                 = blau;
        String hrLinienDicke                 = liniendicke;
        String hrLinienArt                   = linienart;
        String inputAktivHintergrundFarbe    = grau5;
        String inputReadonlyHintergrundFarbe = grau4;
        String inputPassivHintergrundFarbe   = grau4;
        String inputPassivFarbe              = schwarz;
        String inputRandFarbe1               = grau1;
        String inputRandFarbe2               = grau5;
        String inputRandDicke                = liniendicke;
        String inputRandArt                  = linienart;
        String inputButtonHintergrundFarbe   = grau3;
        String legendenFarbe                 = blau;
        String linkFarbe                     = blau;
        String linkAktivFarbe                = tuerkis;
        String linkBesuchtFarbe              = blau;
        String linkFocusFarbe                = tuerkis;
        String objectGitterFarbe             = grau5;
        String objectGitterDicke             = liniendicke;
        String objectGitterArt               = linienart;
        String tabellenGitterFarbe           = grau5;
        String tabellenGitterDicke           = liniendicke;
        String tabellenGitterArt             = linienart;
    %>
    <%-- ----------------------------------------------- --%>
    <%-- Textdarstellung mittels der Display-Eigenschaft --%>
    <%-- in den Tags div und span                        --%>
    <%-- ----------------------------------------------- --%>
    *.table {
        display:table;
        border-collapse:collapse;
    *.tbody {
        display:table-row-group;
    *.tr {
        display:table-row;
    *.td,*.tdright,*.tdleft,*.tdinfo,*.th {
        display:table-cell;
        padding:3px;
        vertical-align:middle;
    *.td,*.th {
        text-align:center;
    *.tdright {
        text-align:right;
    *.tdleft {
        text-align:left;
    *.tdinfo {
        color:<%=infoTextFarbe%>;
        text-align:right;
    *.th {
        color:<%=infoTextFarbe%>;
        font-weight:bold;
    }thanks in advance
    benjamin

    Hello Zhong Li,
    many thanks for your post, but it didn't work.
    My problem is that the JSF-Components im my included or imported
    JSP-Pages does not accept any kind of style or styleClass for
    designing. The components take over the informations for colors
    but not for alignment.
    When I take a look at the generated JAVA-Source in $TOMCAT/WORK/WEBAPP for my sub.jsp ( sub.java )
    it seems that the resulting HTML-page would be presented correctly.
    But later when I start the application via Firefox or Mozilla the html-sourcecode is totally wrong.
    In my example I create a simple grid with 2 rows and 2 columns.
    Both columns contains JSF-Outtext-Components and are included with div-tags.
    The generated Sub.java shows that the text would be setted in the div-tags. Unfortunately the html-sourcecode represented by my browser shows that jsf-text is not setted in the tags but in the <h:form> tags. The div-tags are neither rounded by <h:form> nor containing the JSF-OutText-Components.
    Any clue?
    Many thanks Benjamin
    Here is the html-code from Firefox:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="http://polaris21:8080/webtest/">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <form id="_id0" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
              <div class="table">
                   <div class="tr">
                        <span class="tdleft">value 1</span>
                        <span class="tdinfo">value 2</span>
                   </div>
                   <div class="tr">
                        <span class="tdleft">value 3</span>
                        <span class="tdinfo">value 4</span>
                   </div>
              </div>
              <input type="hidden" name="_id0" value="_id0" />
         </form>     
          <form id="SUB:_id5" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
               <span class="tdleft">value 11</span>
              <span class="tdinfo">value 22</span>
              <span class="tdleft">value 33</span>
              <span class="tdinfo">value 44</span>
              <input type="hidden" name="SUB:_id5" value="SUB:_id5" />
         </form>
         <div class="table">
              <div class="tr">
              </div>
              <div class="tr">
              </div>
         </div>
    </body>
    </html>

  • Problems with notes and mark ups in pdf

    I'm having problems with the Adobe reader for iPad.
    Whenever I modify a pdf file, adding notes or any other mark up, I'm not able to see any of the markups in the file when I open the same file with another application or I send it via e-mail.
    Only the digital signature is still visible.
    Thanks

    You are correct. When i open it with Adobe i get my mark ups etc. When i use Apple`s pdf view i do not.
    Problem solved.
    Date: Mon, 17 Dec 2012 10:46:22 -0700
    From: [email protected]
    To: [email protected]
    Subject: Problems with notes and mark ups in pdf
    Re: Problems with notes and mark ups in pdf created by Pat Wibbeler in Adobe Reader for iOS - View the full discussion
    Can you share what applications you are using to view the notes after emailing? You have to view the document in a Reader that supports annotations. Apple ships a built in pdf viewer (like the one used in iBooks) that many iOS developers use (e.g. Dropbox, email). This built in PDF viewer does not support rendering annotations. However, many other applications (like the Adobe Reader for iOS and the Adobe desktop products) do support Annotation rendering. Similarly, one of our competitor's PDF viewers (PDFExpert) supports this functionality as well. Annotations are part of the PDF standard and the specification is widely available and we would love to see more renderers support it!
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4927598#4927598
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4927598#4927598
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4927598#4927598. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Reader for iOS by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Problem with JFrame and busy/wait Cursor

    Hi -- I'm trying to set a JFrame's cursor to be the busy cursor,
    for the duration of some operation (usually just a few seconds).
    I can get it to work in some situations, but not others.
    Timing does seem to be an issue.
    There are thousands of posts on the BugParade, but
    in general Sun indicates this is not a bug. I just need
    a work-around.
    I've written a test program below to demonstrate the problem.
    I have the problem on Solaris, running with both J2SE 1.3 and 1.4.
    I have not tested on Windows yet.
    When you run the following code, three JFrames will be opened,
    each with the same 5 buttons. The first "F1" listens to its own
    buttons, and works fine. The other two (F2 and F3) listen
    to each other's buttons.
    The "BUSY" button simply sets the cursor on its listener
    to the busy cursor. The "DONE" button sets it to the
    default cursor. These work fine.
    The "SLEEP" button sets the cursor, sleeps for 3 seconds,
    and sets it back. This does not work.
    The "INVOKE LATER" button does the same thing,
    except is uses invokeLater to sleep and set the
    cursor back. This also does not work.
    The "DELAY" button sleeps for 3 seconds (giving you
    time to move the mouse into the other (listerner's)
    window, and then it behaves just like the "SLEEP"
    button. This works.
    Any ideas would be appreciated, thanks.
    -J
    import java.awt.BorderLayout;
    import java.awt.Cursor;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    public class BusyFrameTest implements ActionListener
    private static Cursor busy = Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR);
    private static Cursor done = Cursor.getDefaultCursor();
    JFrame frame;
    JButton[] buttons;
    public BusyFrameTest (String title)
    frame = new JFrame (title);
    buttons = new JButton[5];
    buttons[0] = new JButton ("BUSY");
    buttons[1] = new JButton ("DONE");
    buttons[2] = new JButton ("SLEEP");
    buttons[3] = new JButton ("INVOKE LATER");
    buttons[4] = new JButton ("DELAY");
    JPanel buttonPanel = new JPanel();
    for (int i = 0; i < buttons.length; i++)
    buttonPanel.add (buttons);
    frame.getContentPane().add (buttonPanel);
    frame.pack();
    frame.setVisible (true);
    public void addListeners (ActionListener listener)
    for (int i = 0; i < buttons.length; i++)
    buttons[i].addActionListener (listener);
    public void actionPerformed (ActionEvent e)
    System.out.print (frame.getTitle() + ": " + e.getActionCommand());
    if (e.getActionCommand().equals ("BUSY"))
    frame.setCursor (busy);
    else if (e.getActionCommand().equals ("DONE"))
    frame.setCursor (done);
    else if (e.getActionCommand().equals ("SLEEP"))
    frame.setCursor (busy);
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.print (" finished");
    else if (e.getActionCommand().equals ("INVOKE LATER"))
    frame.setCursor (busy);
    SwingUtilities.invokeLater (thread);
    else if (e.getActionCommand().equals ("DELAY"))
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (busy);
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.print (" finished");
    System.out.println();
    Runnable thread = new Runnable()
    public void run()
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.println (" finished");
    public static void main (String[] args)
    BusyFrameTest f1 = new BusyFrameTest ("F1");
    f1.addListeners (f1);
    BusyFrameTest f2 = new BusyFrameTest ("F2");
    BusyFrameTest f3 = new BusyFrameTest ("F3");
    f2.addListeners (f3); // 2 listens to 3
    f3.addListeners (f2); // 3 listens to 2

    I've had the same problems with cursors and repaints in a swing application, and I was thinking of if I could use invokeLater, but I never got that far with it.
    I still believe you would need a thread for the time consuming task, and that invokeLater is something you only need to use in a thread different from the event thread.

  • Problem with installing and running some applications or drivers

    When installing and installing some items, towards the end of the installation I get this message:
    /System/Library/Extensions/comcy_driver_USBDevice.kext
    *was installed improperly and cannot be used. Please try reinstalling it or contact product's vendor for update*
    The end result is that some things do not seem to work properly, such as my HP printer. Would anybody have any ideas on how to fix this problem?

    Thank you for your response. Originally, I had a problem with Airport and ended up reinstalling Snow Leopard. Since then, when downloading upgrades etc, such as HP printer drivers, iTunes etc., towards the end of the download when its running the script, I get this message: /System/Library/Extensions/comcy_driver_USBDevice.kext
    +was installed improperly and cannot be used. Please try reinstalling it or contact product's vendor for update+
    Sometimes, the download hangs and is unable to complete. The main problem I've encountered so far with an application is when I use the printer to scan an image via Preview, it's blank: there's nothing there.

  • Problems with outlook and address book contacts: my outlook contacts had around 3,000 entries. Outlook duplicated by itself and now outlook and address book have each over 340,000. What should I do?

    Problems with outlook and address book contacts: my outlook contacts had around 3,000 entries. Outlook duplicated entries and have now 340,000. I reinstalled microsoft office and, thus, outlook, and reinstalled mac OS X system and applications. While I managed to delete outlook contacts so that I can re-sync with my blackberry, the contacts at Mac Address Book were not deleted and still have over 340,000 entries. I do not mind deleting all contacts since I have back up, but I have not been able to delete them. Also, when I go at Address Book and try to delete or merge duplicated entries, the system takes forever and never ends because of such large amount of entries. Worse, when I do so I run out of RAM memory.
    My Macbook pro is just 2 months old.
    What should I do? Is there a way to delete my Mac Address Book without having the problem above?
    Many thanks
    Regis

    zlatan24 wrote:
    For solving out troubles connected with corrupted or lost address book you may use address book recovery. It owns various features such as restoring wab files, it working under any Windows OS. The utility has modern and easy to use interface due to almost every experienced users.
    If it is a windows problem it's not going to run on the OP's MacBook Pro

  • Problems with Safari and Firefox (HTTP?)

    Problems with Safari and Firefox (HTTP?)
    On a laptop G4, 10.5.8 and Safari 5.02 I experience the following:
    On the account of my oldest daughter everything works fine, i.e. wireless internet works and no problems with mail or safari.
    On the same laptop, on the account of my other daughter, the wireless is OK, she can mail etc. But safari nor firefox works. It says: can’t find server (whatever site) and in the activity window it looks if safari tries to open files (in the safari preferences-folder) in stead of http. Same applies to Firefox, so maybe it has more to do with HTTP in general?
    What goes wrong? What to do? I tried the following on the host terminal (tips from Apple)
    defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
    and
    defaults delete com.apple.safari WebKitDNSPrefetchingEnabled
    but that did not help,
    Nanne

    I'm still wondering why it happens now at this moment in time...
    PC does seem to be a bit odd & inconsistent, the few times I've tested with it, at least so far as we content filtering goes; and if I remember rightly, you're not the first to report previously ok settings suddenly preventing some or all internet until pc is switched off altogether.
    It may work when re-enabled

  • Haven't been able to use pages for a while.  Keep getting following message.  Have tried reinstalling iWork, but no luck.  Same problems with Keynote and Numbers/Users/scottmcdonald/Desktop/Screen Shot 2012-03-14 at 9.39.52 PM.png

    Haven't been able to use pages for a while.  Keep getting following message.  Have tried reinstalling iWork, but no luck.  Same problems with Keynote and Numbers/

    Have you moved Pages from its installed location? Or just dragged a copy to your current system?
    It can't find some of its resources apparently.
    Peter

  • Problem with DMGs and error: "No Mountable File Systems"

    Problem with DMGs and error: "No Mountable File Systems"
    The files are not corrupt. The problem is occurring with all DMGs that are apparently formatted in MS-DOS FAT16. No the file will not mount with Disk utility or any other disk mounter programs I have found.
    This is now the second time this occurred and now effects my MBP and my iMac. First time i spent days with Apple support and the only solution was ultimately back up the data, reformat the HD, start over from scratch and reload everything. That lasted about a month before the problem resurfaced and is now an issue on both iMac and MBP.
    I tried to identify all the programs I installed immediately before the error, as I am convinced it is the result of a software conflict.
    Recent programs includes:
    1) upgrading from Parallels 5.5 to 6.0 on both machines.
    2) using an HP secure II usb drive and setting up a secure disk.
    3) installing new itunes 10
    4) new update to Flip For Mac.
    The files affected are downloaded dmgs, including personal brain and google earth, both which are formatted in FAT16.
    Any help or thoughts? Apple has now spent hours trying and they say i now have to reformat and wipe and start over. That is unacceptable and based on pasted experience the problem is likely to repeat itself. having to wipe and rebuild a HD ever month is not an solution. i need to fid the root problem.
    In the meantime, anyone got a real solution on how to extract the data for a DMG using a different method?
    Message was edited by: remaia

    Where you able to find the solution, i am having the same problem, all was fine till i install some programs only same one i saw did we both did was flip4mac i uninstalled it but the problem is still there, i also restored and erased the hardrive but im not up to doing that all over again. If you found anything out let me know i would greatly appreciate it

  • Problem with Send and Receive Emal In SAP System

    Hi gurus!
    I have a following quote:
    Dear !
    I have a problem with send and receive email in SAP system following :
    I want to test send and receive email in local network at my company. I
    had two server
    Server 1 : I setup Exchange Mail Server 2007 with domain controller is
    fes.com
    Server 2 : I setup SAP ERP ECC 6.0
    On Server 1 : I created 2 account ( u1Afes.com and u2Afes.com ) and then I tested send and receive email between u1 and u2 in local network through Microsoft Outlook 2007 -> OK
    and then
    On Server 2: I had configured send and receive email on SAP system
    through tcode SBWP, SCOT and SOST as Note 455140 - "Configuration of
    e-mail, fax, paging or SMS using SMTP"
    for example :
    I logged in SAP system with user Basis01 (with email u1Afes.com ) -> then,using tcode SBWP -> new message -> send to u2Afes.com with Internet Mail type and then status message with green light -> sending ok
    and then I have used Microsoft Outlook 2007, I logged with account u2 ->check email -> Ok. I saw message which send from u1
    Finally, My problem is how can receive mail in SAP system without using Microsoft Outlook
    For example:
    Login system SAP with Basis01 account (with  u1Afes.com ) -> tcode SBWP ->New Message -> send to u2Afes.com
    and then
    Login system SAP with Basis02 account (with u2Afes.com ) -> tcode ??? ->
    To receive email from Basis01 (with u1Afes.com )
    Please help me now
    Thanks
    I replace "@" with "A" because of banning email of this forum.
    This quote is about sending email in local network. And we can't receive any email from the outside email address. Addition if I wanna send email to internal email in Internet (we've just tried with email address in local network) What should I config in SAP and Exchange ?
    By the way, Is SAP Server IP added to Relay Agent for sending or receiving mail ?
    Regards
    An NLP
    Edited by: An NLP on Apr 6, 2010 7:03 PM

    Hi,
    This problem is a classic problem of mail routing via Exchange. Exchange like most mail servers use the domain part of the email address as a means to route mails. So I will make an assumption that your main company mail addrss is "User @ fes.com".
    So when you send a mail to the "User @ fes.com mail" address the mail is delivered to your Outlook mail address as this is the default route for company.
    (Q) So how do you get your Exchange server to relay the mail into the sending SAP system?
    (A) The easiest way would be to setup and unique mail domain for your SAP system. I always recommend "user @ client.sid.company.com" which in your case would be "u1 @ 100.PRD.fes.com". You can then instruct Exchange to send any emails addressed to 100.PRD.fes.com domain to your SAP system. Also using this format of address you can configure multiple mail connections into multiple SAP systems.
    (A) Another answer would be to enter the "Full" email address (LOcal and Domain part of address) into the routing rule for Exchange e.g. "U1 @ fes.com" so that all emails addressed to this user will be delivered into SAP. However this method requires a lot of Admin as you will have to update Exchange with ALL email address that need to receive emails. Also if your corporate mail address is "U1 @ fes.com" then all mails will be forwarded to SAP.
    I would definitely NOT recommend this method but the decision is up to you.
    P.S. The IP address of the SAP system is entered into the mail header of the email. This is standard practice in SMTP relay. You can suppress this header in Exchange
    Hope this helps
    Michael

  • Problem with Speaker and Headset in Windows Vista

    Hi, I just got my Macbook Pro 13" and having problem with speaker and headset when working with Windows Vista (I have installed the driver from bootcamp). The sound very weak if I play music from Itunes or youtube even the volume already full and if i put my headset the sound not coming out. Is there anyone can help me to solve this problem?
    Regards,Edwin

    When you post about Windows / Boot Camp, in Mac Pro (workstation) forum where others with a MacBOOK would be more likely to have same hardware configuration, and you won't find Windows drivers on Apple downloads. More like at
    http://www.guru3d.com or other sites, or go to RealTek (if that is the type of audio you have).

  • Problem with trigger and entity in JHeadsart, JBO-25019

    Hi to all,
    I am using JDeveloper 10.1.2 and developing an application using ADF Business Components and JheadStart 10.1.2.27
    I have a problem with trigger and entity in JHeadsart
    I have 3 entity and 3 views
    DsitTelephoneView based on DsitTelephone entity based on DSIT_TELEPHONE database table.
    TelUoView based on TelUo entity based on TEL_UO database table.
    NewAnnuaireView based on NewAnnuaire entity based on NEW_ANNUAIRE database view.
    I am using JHS to create :
    A JHS table-form based on DsitTelephoneView
    A JHS table based on TelUoView
    A JHS table based on NewAnnuaireView
    LIB_POSTE is a :
    DSIT_TELEPHONE column
    TEL_UO column
    NEW_ANNUAIRE column
    NEW_ANNUAIRE database view is built from DSIT_TELEPHONE database table.
    Lib_poste is an updatable attribut in TelUo entity, DsitTelephone entity, NewAnnuaire entity.
    Lib_poste is upadated in JHS table based on TelUoView
    I added a trigger on my database shema « IAN » to upadate LIB_POSTE in DSIT_TELEPHONE database table :
    CREATE OR REPLACES TRIGGER “IAN”.TEL_UO_UPDATE_LIB_POSTE
    AFTER INSERT OR UPDATE OFF lib_poste ONE IAN.TEL_UO
    FOR EACH ROW
    BEGIN
    UPDATE DSIT_TELEPHONE T
    SET t.lib_poste = :new.lib_poste
    WHERE t.id_tel = :new.id_tel;
    END;
    When I change the lib_poste with the application :
    - the lib_poste in DSIT_TELEPHONE database table is correctly updated by trigger.
    - but in JHS table-form based on DsitTelephoneView the lib_poste is not updated. If I do a quicksearch it is updated.
    - in JHS table based on NewAnnuaireView the lib_poste is not updated. if I do a quicksearch, I have an error:
    oracle.jbo.RowAlreadyDeletedException: JBO-25019: The row of entity of the key oracle.jbo. Key [null 25588] is not found in NewAnnuaire.
    25588 is the primary key off row in NEW_ANNUAIRE whose lib_poste was updated by the trigger.
    It is as if it had lost the bond with the row in the entity.
    Could you help me please ?
    Regards
    Laurent

    The following example should help.
    SQL> create sequence workorders_seq
      2  start with 1
      3  increment by 1
      4  nocycle
      5  nocache;
    Sequence created.
    SQL> create table workorders(workorder_id number,
      2  description varchar2(30),
      3   created_date date default sysdate);
    Table created.
    SQL> CREATE OR REPLACE TRIGGER TIMESTAMP_CREATED
      2  BEFORE INSERT ON workorders
      3  FOR EACH ROW
      4  BEGIN
      5  SELECT workorders_seq.nextval
      6    INTO :new.workorder_id
      7    FROM dual;
      8  END;
      9  /
    Trigger created.
    SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
    Session altered.
    SQL> insert into workorders(description) values('test1');
    1 row created.
    SQL> insert into workorders(description) values('test2');
    1 row created.
    SQL> select * from workorders;
    WORKORDER_ID DESCRIPTION                    CREATED_DATE
               1 test1                          30-NOV-2004 15:30:34
               2 test2                          30-NOV-2004 15:30:42
    2 rows selected.

  • Problem with ADS and LDAP

    Problem with ADS and LDAP
    I have installed Win2000 + sp1 and ADS on a computer. This computer is PDC.
    After connection via LDAP I cann't get any object ( users or goups etc. ).
    I try connect to ADS by java ( JNDI ).
    When I use another clients of LDAP ( eg. Maxware Directory Explorer) I have
    the same problem - no objects.
    Can anybody help me?
    Grzegorz Pszona
    my e-mail: [email protected]

    Thanks a lot.
    Softerra's browser is really good.
    Thanks
    Rashmi
    "Anant Kadiyala" <[email protected]> wrote:
    >
    I used Softerra's LDAP browser. The browser is free. There is also a
    java baded
    LDAP browser from Univ of Michigan. I found the Softerra browser to be
    more easier
    to use.
    -anant
    "rashmi" <[email protected]> wrote:
    Hi,
    Can you please let me know which exact ADS tool that you used to examine
    the
    DN. I have Active Directory Users and Computers, Sites and Servicesand
    Domain
    and Trusts installed on my machine but I am not able to figure out how
    to get
    the DN?
    Thanks
    Rashmi
    for Stephen Davies <[email protected]> wrote:
    Grzegorz,
    I have had WLS6.1 & ADS working ok using LDAP V2. Mind you it did take
    a
    fair bit of messing around to get it going. MS does have a few oddities,
    for example the Administrators DN might look something like this:
    cn=Administrator,cn=Users,dc=eglobal,dc=net
    One tool that I found invaluable came with the additional support tools
    for Windows 2000. The 'Active Directory Administration Tool' made it
    easy to list the directory contents and examine the DNs.
    Regards,
    Steve
    Stephen Davies
    Principal Consultant
    eGlobal Services Pty. Ltd.
    Sydney, Australia
    Ph. +61 2 9283 1033
    http://www.eglobal.net/

Maybe you are looking for

  • How Can I print directly the report from the printer without showing it ?

    I know how to run the report from Form as it illustrate on this site: http://www.lv2000.com/articles/runreport.htm but the question here how could i to generate the report directly to the printer without showing it on the screen??? I search on the ne

  • [SOLVED] ldconfig: File /lib/libhandle.so.1.0.3 is empty, not checked

    ldconfig: File /lib/libhandle.so.1.0.3 is empty, not checked. ldconfig: File /lib/libhandle.so.1 is empty, not checked. ldconfig: File /lib/libproc-3.2.8.so is empty, not checked. ldconfig: File /lib/libhandle.so is empty, not checked. ldconfig: File

  • Third party IP phone services

    Any recommendation for third party IP phone services? I have found two: www.andtek.com and www.berbee.com. Thanks!

  • Problems with inbound aleaud

    Hi everybody, I have an Orders Idoc in two logical systems as Outbound Idoc. Only in one of them I need an Inboud Aleaud Idoc as ACK. You can customize the inbound aleaud idocs in program IDX_NOALE that fills the table IDXNOALE. You can choose de typ

  • Using pen tool to draw a particular shape...

    Hi all, I'm pretty new to Illustrator and just wanted some advice. I'm using the pen tool to try and draw a specific shape () but finding it hard trying to 'smooth' out the points where I connect my lines. The pen tool can't draw this all in one go,