-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from Divyesh000/getting-started
write tutorial for getting started
- Loading branch information
Showing
6 changed files
with
232 additions
and
4 deletions.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/github/creme332/utils/IconCellRenderer.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.github.creme332.utils; | ||
|
||
import javax.swing.*; | ||
import javax.swing.table.DefaultTableCellRenderer; | ||
import java.awt.*; | ||
|
||
import org.kordamp.ikonli.swing.FontIcon; | ||
|
||
public class IconCellRenderer extends DefaultTableCellRenderer { | ||
@Override | ||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { | ||
// Use JLabel to handle the icon rendering | ||
JLabel label = new JLabel(); | ||
if (value instanceof ImageIcon) { | ||
label.setIcon((ImageIcon) value); | ||
} else if (value instanceof FontIcon) { | ||
label.setIcon((FontIcon) value); | ||
} | ||
// Center the icon | ||
label.setHorizontalAlignment(CENTER); | ||
return label; | ||
} | ||
} | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.