前端里 easy-ui icon 图片怎么增加?

前端里 easy-ui icon 图片怎么增加?,第1张

在jquery easy-ui目录下的themes/icon.css。这个液悄模css文件打开你就知道了。里面都是icon的css。你可以任意添加闹缓。一下是默认的icon css:运纤

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

.icon-blank {

background: url('icons/blank.gif') no-repeat center center

}

.icon-add {

background: url('icons/edit_add.png') no-repeat center center

}

.icon-edit {

background: url('icons/pencil.png') no-repeat center center

}

你可以实现一个 TableCellRenderer

class MyTableCellRenderer implements TableCellRenderer{

public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)

//根据特定的单元拿旅格设置不同的Renderer,假如你要在第2行第3列显示图标消洞凳颤枝

if(row == 1 &&column == 2) {

ImageIcon icon = new ImageIcon("icon的位置")

JLabel label = new JLabel(icon)

label.setOpaque(false)

return label

} else {

......

......

}

}

然后把这个Renderer设置到第一列上

TableCellRenderer myRenderer = new MyTableCellRenderer()

table.getColumnModel.getColumn(2).setCellRenderer(myRenderer)


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/8033675.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-12
下一篇2023-04-12

发表评论

登录后才能评论

评论列表(0条)

    保存