This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new javax.swing.JTable(){ | |
public boolean isCellEditable(int rowIndex, int colIndex) { | |
return false; //Disallow the editing of any cell | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
import java.awt.event.*; | |
import java.util.*; | |
import javax.swing.*; | |
import javax.swing.border.*; | |
/* | |
* Simple implementation of a Glass Pane that will capture and ignore all | |
* events as well paint the glass pane to give the frame a "disabled" look. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
import java.awt.event.*; | |
import java.util.*; | |
import javax.swing.*; | |
/* | |
* Custom model to make sure the items are stored in a sorted order. | |
* The default is to sort in the natural order of the item, but a | |
* Comparator can be used to customize the sort order. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.sql.*; | |
public class ListTableModel extends RowTableModel<List> | |
{ | |
/** | |
* Initialize the List with null values. This will set the size of the | |
* List and will prevent an IndexOutOfBoundsException when trying to | |
* access an Element in the List. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.*; | |
import java.util.*; | |
import javax.swing.table.*; | |
/** | |
* A TableModel that better supports the processing of rows of data. That | |
* is, the data is treated more like a row than an individual cell. Hopefully | |
* this class can be used as a parent class instead of extending the | |
* AbstractTableModel when you need custom models that contain row related | |
* data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TableCellRenderer headerRenderer = new VerticalTableHeaderCellRenderer() { | |
Font font = new Font(Font.MONOSPACED, Font.ITALIC, 12); | |
@Override | |
public Component getTableCellRendererComponent(JTable table, | |
Object value, boolean isSelected, boolean hasFocus, int row, | |
int column) { | |
super.getTableCellRendererComponent(table, value, isSelected, | |
hasFocus, row, column); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @(#)VerticalTableHeaderCellRenderer.java 1.0 02/26/09 | |
*/ | |
package darrylbu.renderer; | |
import darrylbu.plaf.vertical.VerticalLabelUI; | |
import java.awt.Component; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
import javax.swing.Icon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Frame; | |
import java.awt.Toolkit; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.KeyEvent; | |
import java.awt.event.WindowEvent; | |
import javax.swing.Action; | |
import javax.swing.AbstractAction; | |
/** | |
* This class will create and dispatch a WINDOW_CLOSING event to the active |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
/** | |
* This class will help you take control of the frame closing process by | |
* providing a WindowListener with some common features that might be used | |
* when closing an application. That is you can: | |
* <ul> | |
* <li>display an application closing confirmation message which will give |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.BorderLayout; | |
import java.awt.Graphics; | |
import javax.swing.JComponent; | |
/** | |
* A wrapper Container for holding components that use a background Color | |
* containing an alpha value with some transparency. | |
* | |
* A Component that uses a transparent background should really have its | |
* opaque property set to false so that the area it occupies is first painted |
NewerOlder