-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d36bfe9
commit 635a4e6
Showing
8 changed files
with
451 additions
and
440 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
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 |
---|---|---|
@@ -1,36 +1,36 @@ | ||
package view; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class EventLabelRenderer extends JLabel implements javax.swing.ListCellRenderer { | ||
@Override | ||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { | ||
|
||
if (isSelected) { | ||
setBackground(list.getSelectionBackground()); | ||
setForeground(list.getSelectionForeground()); | ||
} else { | ||
setBackground(list.getBackground()); | ||
setForeground(list.getForeground()); | ||
} | ||
|
||
this.setText((String) value); | ||
this.setSize(1000, 100); | ||
//this.setEnabled(true); | ||
return this; | ||
//return new JTextField(String.valueOf(value)); | ||
|
||
//Set the icon and text. If icon was null, say so. | ||
// ImageIcon icon = images[selectedIndex]; | ||
// String pet = petStrings[selectedIndex]; | ||
// setIcon(icon); | ||
// if (icon != null) { | ||
// setText(pet); | ||
// setFont(list.getFont()); | ||
//package view; | ||
// | ||
//import javax.swing.*; | ||
//import java.awt.*; | ||
// | ||
//public class EventLabelRenderer extends JLabel implements javax.swing.ListCellRenderer { | ||
// @Override | ||
// public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { | ||
// | ||
// if (isSelected) { | ||
// setBackground(list.getSelectionBackground()); | ||
// setForeground(list.getSelectionForeground()); | ||
// } else { | ||
// setUhOhText(pet + " (no image available)", | ||
// list.getFont()); | ||
// setBackground(list.getBackground()); | ||
// setForeground(list.getForeground()); | ||
// } | ||
} | ||
} | ||
// | ||
// this.setText((String) value); | ||
// this.setSize(1000, 100); | ||
// //this.setEnabled(true); | ||
// return this; | ||
// //return new JTextField(String.valueOf(value)); | ||
// | ||
// //Set the icon and text. If icon was null, say so. | ||
//// ImageIcon icon = images[selectedIndex]; | ||
//// String pet = petStrings[selectedIndex]; | ||
//// setIcon(icon); | ||
//// if (icon != null) { | ||
//// setText(pet); | ||
//// setFont(list.getFont()); | ||
//// } else { | ||
//// setUhOhText(pet + " (no image available)", | ||
//// list.getFont()); | ||
//// } | ||
// } | ||
//} |
Oops, something went wrong.