Re: Advanced-swing digest, Vol 1 #82 - 2 msgs
This raises another question. How to sign applets using JDK 1.3 ? [EMAIL PROTECTED] wrote: > Send Advanced-swing mailing list submissions to > [EMAIL PROTECTED] > > To subscribe or unsubscribe via the World Wide Web, visit > http://eos.dk/mailman/listinfo/advanced-swing > or, via email, send a message with subject or body 'help' to > [EMAIL PROTECTED] > > You can reach the person managing the list at > [EMAIL PROTECTED] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Advanced-swing digest..." > > Today's Topics: > >1. RE: accessing file thru applet (Mads Pultz) >2. Help with JTable column width (Bill Tschumy) > > --__--__-- > > Message: 1 > From: "Mads Pultz" <[EMAIL PROTECTED]> > To: "Ravi Prakash" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Subject: RE: accessing file thru applet > Date: Tue, 24 Apr 2001 16:34:03 +0200 > > If the file you are trying to read isn't located on the machine from where > you downloaded the applet then this answers you question. You need to sign > your applet to read the file. > > Mads > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Ravi > > Prakash > > Sent: 19. april 2001 19:33 > > To: [EMAIL PROTECTED] > > Cc: [EMAIL PROTECTED] > > Subject: accessing file thru applet > > > > > > when i am trying to access a file contents thru applet i am getting > > this error > > > > java.security.AccessControlException: access denied > > (java.io.FilePermission ani_firewall_passthru_ips.txt read) > > > > could any one suggest what went wrong... > > > > > > ravi > > > > ___ > > Swing mailing list > > [EMAIL PROTECTED] > > http://eos.dk/mailman/listinfo/swing > > --__--__-- > > Message: 2 > Date: Tue, 24 Apr 2001 16:49:02 -0500 > To: [EMAIL PROTECTED] > From: Bill Tschumy <[EMAIL PROTECTED]> > Subject: Help with JTable column width > > I've been having a devil of a time trying to get the columns of my > JTable to size correctly. I have a very simple table inside of a > JScrollPane. The rows consist of a 16x16 icon in column 0 and a > String in column 1 (basically a status icon for a hostname). > > I have specified a preferred width of 20 for column 0 and for a while > this was sizing correctly. However, after adding the code in the > TableModel that returns the ImageIcon object for column 0 cells, now > the table insists on allocating equal space to the two columns. I > have verified that the width of the ImageIcons being returned is 16 > pixels. Why is the table allocating so much space to the column? > > Here is the relevant code. > > private HostTableModel tableModel = new HostTableModel(); > > public HostList() > { > TableColumn column; > > setModel(tableModel); > > column = getColumnModel().getColumn(0); > column.setPreferredWidth(20); > column.setMinWidth(20); > column.setMaxWidth(20); > column.setResizable(false); > > column = getColumnModel().getColumn(1); > column.setResizable(false); > > JTableHeader header = getTableHeader(); > header.setResizingAllowed(false); > header.setReorderingAllowed(false); > > setAutoResizeMode(AUTO_RESIZE_LAST_COLUMN); > } > > private class HostTableModel extends AbstractTableModel > { > > public Class getColumnClass(int col) > { > if (col == 0) > return ImageIcon.class; > else > return super.getColumnClass(col); > } > > public int getColumnCount() > { > return columnNames.length; > } > > public int getRowCount() > { > return hosts.size(); > } > > public String getColumnName(int col) > { > return columnNames[col]; > } > > public Object getValueAt(int row, int col) > { > RemoteHost remoteHost = (RemoteHost)hosts.elementAt(row); > if (col == 0) > { > return getHostStatusIcon(remoteHost); > } > else > { > return remoteHost; > } > } > } > > Thanks. > > -- > Bill Tschumy > Otherwise -- Austin, TX > [EMAIL PROTECTED] > > --__--__-- > > ___ > Advanced-swing mailing list > [EMAIL PROTECTED] > http://eos.dk/mailman/listinfo/advanced-swing > > End of Advanced-swing Digest ___ Advanced-swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/advanced-swing
Re: Help with JTable column width
Bill Tschumy schrieb: > Why is the table allocating so much space to the column? How about trying to set the second column to be resizable? > column = getColumnModel().getColumn(0); > column.setPreferredWidth(20); > column.setMinWidth(20); > column.setMaxWidth(20); > column.setResizable(false); > > column = getColumnModel().getColumn(1); > column.setResizable(false); Set this to true. This might solve your resize problems, since for now the JTable has the problem, that according to the ColumnModel it is not allowed to resize but the container of the JTable donates it more spaces. Thus the JTable streches the columns on its own. -- Christian Pesch - Software Engineer [EMAIL PROTECTED] - fon +49.40.325587.505 fax .999 CoreMedia AG - www.coremedia.com - 0700-COREMEDIA Erste Brunnenstraße 1, 20459 Hamburg, Germany CoreMedia - Think ahead! We're there. ___ Advanced-swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/advanced-swing
Re: Help with JTable column width
No, that doesn't help but thanks for the suggestion. I have found a partial solution, but I don't know why my original method fails. When I would change the host status I need to update the icon in column 0. To do so I used the following code. public void statusChanged(RemoteHost host) { tableModel.fireTableRowsUpdated(hosts.indexOf(host), hosts.indexOf(host)); } The call to fireTableRowsUpdated() is what messes up the column widths. If I change this to a simple repaint() on the JTable the new status is correctly displayed. Of course, listeners are not notified, but I can handle that in other ways. Isn't it the case that I should call fireTableRowsUpdated() when I know the TableModel has new data to display? At 9:06 AM + 4/25/01, Christian Pesch wrote: >Bill Tschumy schrieb: > >> Why is the table allocating so much space to the column? > >How about trying to set the second column to be resizable? > >> column = getColumnModel().getColumn(0); >> column.setPreferredWidth(20); >> column.setMinWidth(20); >> column.setMaxWidth(20); >> column.setResizable(false); >> >> column = getColumnModel().getColumn(1); >> column.setResizable(false); > >Set this to true. This might solve your resize problems, >since for now the JTable has the problem, that according >to the ColumnModel it is not allowed to resize but the container >of the JTable donates it more spaces. Thus the JTable streches >the columns on its own. > >-- >Christian Pesch - Software Engineer >[EMAIL PROTECTED] - fon +49.40.325587.505 fax .999 >CoreMedia AG - www.coremedia.com - 0700-COREMEDIA >Erste Brunnenstraße 1, 20459 Hamburg, Germany > >CoreMedia - Think ahead! We're there. -- Bill Tschumy Otherwise -- Austin, TX [EMAIL PROTECTED] ___ Advanced-swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/advanced-swing
RE: Help with JTable column width
If I understand Your problem correctly then Your JTable size is too large. The inital sizing of JTable is something strange. You can try out the following: TableColumnModel columnModel = table.getColumnModel(); columnModel.getColumn(0).setPreferredSize(20); columnModel.getColumn(1).setPreferredSize(20); Dimension preferredViewportSize = new Dimension(20 + 20, 50); table.setPreferredScrollableViewportSize( preferredViewportSize); You should then receive a table of size 40 x 50 pixels, if Your table component is contained in a scrollpane. Regards Urs -Original Message- From: Bill Tschumy [mailto:[EMAIL PROTECTED]] Sent: Mittwoch, 25. April 2001 15:32 To: Christian Pesch Cc: [EMAIL PROTECTED] Subject: Re: Help with JTable column width No, that doesn't help but thanks for the suggestion. I have found a partial solution, but I don't know why my original method fails. When I would change the host status I need to update the icon in column 0. To do so I used the following code. public void statusChanged(RemoteHost host) { tableModel.fireTableRowsUpdated(hosts.indexOf(host), hosts.indexOf(host)); } The call to fireTableRowsUpdated() is what messes up the column widths. If I change this to a simple repaint() on the JTable the new status is correctly displayed. Of course, listeners are not notified, but I can handle that in other ways. Isn't it the case that I should call fireTableRowsUpdated() when I know the TableModel has new data to display? At 9:06 AM + 4/25/01, Christian Pesch wrote: >Bill Tschumy schrieb: > >> Why is the table allocating so much space to the column? > >How about trying to set the second column to be resizable? > >> column = getColumnModel().getColumn(0); >> column.setPreferredWidth(20); >> column.setMinWidth(20); >> column.setMaxWidth(20); >> column.setResizable(false); >> >> column = getColumnModel().getColumn(1); >> column.setResizable(false); > >Set this to true. This might solve your resize problems, >since for now the JTable has the problem, that according >to the ColumnModel it is not allowed to resize but the container >of the JTable donates it more spaces. Thus the JTable streches >the columns on its own. > >-- >Christian Pesch - Software Engineer >[EMAIL PROTECTED] - fon +49.40.325587.505 fax .999 >CoreMedia AG - www.coremedia.com - 0700-COREMEDIA >Erste Brunnenstraße 1, 20459 Hamburg, Germany > >CoreMedia - Think ahead! We're there. -- Bill Tschumy Otherwise -- Austin, TX [EMAIL PROTECTED] ___ Advanced-swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/advanced-swing ___ Advanced-swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/advanced-swing
JTable Problem!
I have this problem: when I make double click on a row of my JTable this become enabled and a user can modify the value contained. All the datas in the row must be visible but not enabled for some modification. I have tried with the methos setEnable(false) but don't work. Please help me. G. Fazioli [EMAIL PROTECTED]
adding a row to jtable
HI, I have three rows of data in the table and i am using table model to setvalue and getvalue of table rows. The problem is when i delete the second row in the table, the third row moves to second row - fine as expected but when i add another row to the table it is adding to the fourth row not to the third row could any pour light on this... raviprakash ___ Advanced-swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/advanced-swing
signing applets
From: [EMAIL PROTECTED] > > This raises another question. How to sign applets using JDK 1.3 ? > You can use Sun's jarsigner or Netscape's signtool. Take a look at: Trail: Security in Java 2 SDK 1.2 http://java.sun.com/docs/books/tutorial/security1.2/index.html and NETSCAPE OBJECT SIGNING http://developer.netscape.com/docs/manuals/signedobj/trust/owp.htm Tim Telcik [EMAIL PROTECTED] ___ Advanced-swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/advanced-swing