Package javax.swing.table

Examples of javax.swing.table.DefaultTableCellRenderer


        }

        TableColumn rolesColumn = resourceTable.getColumnModel().getColumn(4);
        comboBox.setEditable(false);
        rolesColumn.setCellEditor(new DefaultCellEditor(comboBox));
        rolesColumn.setCellRenderer(new DefaultTableCellRenderer());
    }
View Full Code Here


  public DCTableCellRenderer(DCTable table) {
    super();
    _table = table;
    _alignmentOverrides = new HashMap<Integer, Alignment>();
    _delegate = new DefaultTableCellRenderer();
  }
View Full Code Here

        topPanel.add(comboPanel, BorderLayout.WEST);
        topPanel.add(rangePanel, BorderLayout.EAST);
       
        myComponent.add(topPanel, BorderLayout.NORTH);
        myDataTable = new JTable();
        myDataTable.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() {
            private static final long serialVersionUID = 1L;

            @Override
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                    boolean hasFocus, int row, int column) {
View Full Code Here

    /**
     * Returns a renderer that displays the catalog id of a piece of furniture.
     */
    private TableCellRenderer getCatalogIdRenderer() {
      return new DefaultTableCellRenderer() {
        @Override
        public Component getTableCellRendererComponent(JTable table,
             Object value, boolean isSelected, boolean hasFocus,
             int row, int column) {
          HomePieceOfFurniture piece = (HomePieceOfFurniture)value;
View Full Code Here

    /**
     * Returns a renderer that displays the name of a piece of furniture with its icon ahead.
     */
    private TableCellRenderer getNameWithIconRenderer() {
      return new DefaultTableCellRenderer() {

        @Override
        public Component getTableCellRendererComponent(JTable table,
             Object value, boolean isSelected, boolean hasFocus,
             int row, int column) {
View Full Code Here

    /**
     * Returns a renderer that displays the angle property of a piece of furniture.
     */
    private TableCellRenderer getAngleRenderer() {
      return new DefaultTableCellRenderer() {
        private TableCellRenderer integerRenderer;
       
        @Override
        public Component getTableCellRendererComponent(JTable table,
             Object value, boolean isSelected, boolean hasFocus,
View Full Code Here

    /**
     * Returns a renderer that displays the value added tax percentage property of a piece of furniture.
     */
    private TableCellRenderer getValueAddedTaxPercentageRenderer() {
      return new DefaultTableCellRenderer() {
        @Override
        public Component getTableCellRendererComponent(JTable table,
             Object value, boolean isSelected, boolean hasFocus,
             int row, int column) {
          BigDecimal valueAddedTaxPercentage = ((HomePieceOfFurniture)value).getValueAddedTaxPercentage();
View Full Code Here

    /**
     * Returns a renderer that displays the RGB value of the color property
     * of a piece of furniture in a bordered label.
     */
    private TableCellRenderer getColorRenderer() {
      return new DefaultTableCellRenderer() {
        // A square icon filled with the foreground color of its component
        // and surrounded by table foreground color
        private Icon squareIcon = new Icon () {
          public int getIconHeight() {
            return getFont().getSize();
View Full Code Here

  
    /**
     * Returns a renderer that displays the texture of a piece as an icon.
     */
    private TableCellRenderer getTextureRenderer() {
      return new DefaultTableCellRenderer() {
        {
          setHorizontalAlignment(CENTER);
        }
       
        @Override
View Full Code Here

    }
  }
 
    public static void setTableHeaderCellRenderer(TableColumn tableCol)
    {
    tableCol.setHeaderRenderer(new DefaultTableCellRenderer()
    {
      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
      {
        if (table != null)
        {
View Full Code Here

TOP

Related Classes of javax.swing.table.DefaultTableCellRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.