Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
// This customized renderer can render objects of the type MyIcon
class RotatedTableCellRenderer extends JLabel implements TableCellRenderer {
protected int m_degreesRotation = -90;
public RotatedTableCellRenderer() { };
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
// Inherit the colors and font from the header component
if (table != null) {
JTableHeader header = table.getTableHeader();
//header.setBounds(column*20, 0, 100, 20);
if (header != null) {
setForeground(header.getForeground());
setBackground(header.getBackground());
setFont(header.getFont());
}
}
if (value instanceof MyIcon) {
setIcon( ( (MyIcon) value).icon);
}
else {
setIcon(null);
}
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
setHorizontalAlignment(JLabel.CENTER);
this.setText(value.toString());
this.repaint();
return this;
}
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setClip(0, 0, 500, 100);
g2.setColor(Color.BLACK);
g2.setFont(this.getFont());
AffineTransform at = new AffineTransform();
at.setToTranslation(this.getWidth(), this.getHeight());
g2.transform(at);
double radianAngle = ( ( (double) m_degreesRotation) / ( (double) 180)) *
Math.PI;
at.setToRotation(radianAngle);
g2.transform(at);
//String text = "<html>HEADER</html>";
g2.drawString(this.getText(), 0.0f, 0.0f);
}
}