2016-05-12 24 views
1

我有一個Java項目使用JTable,但設計是非常基本的。有沒有方法或插件來更新Eclipse JTable的基本設計?還是沒有辦法改變它的風格或主題?JTable樣式或主題爲Java Swing

+0

你在用swing嗎? – PeaceIsPearl

+0

是的,即時使用Windows生成器,但不喜歡如何顯示Jtable –

+0

請使用JFormDesigner查看您的GUI – PeaceIsPearl

回答

3

JTable的外觀由其UI委託控制,通常爲TableUI的子類。代表選擇由選定的Look & Feel控制。使用下面的Table鍵,調用UIManager.put(),如here所示,更改所需的屬性。下面給出幾個常見的幾個相關按鍵。請注意,特定的外觀可能會選擇忽略您的更改。

*** Metal javax.swing.plaf.metal.MetalLookAndFeel 641 entries 
Table.dropCellBackground: javax.swing.plaf.ColorUIResource[r=210,g=233,b=255] 
Table.background: javax.swing.plaf.ColorUIResource[r=255,g=255,b=255] 
TableHeader.font: [email protected] 
TableHeader.focusCellBackground: javax.swing.plaf.ColorUIResource[r=200,g=221,b=242] 
Table.focusCellHighlightBorder: [email protected] 
TableHeader.foreground: sun.swing.PrintColorUIResource[r=51,g=51,b=51] 
Table.dropLineColor: javax.swing.plaf.ColorUIResource[r=99,g=130,b=191] 
Table.font: [email protected] 
TableHeader.background: javax.swing.plaf.ColorUIResource[r=238,g=238,b=238] 
TableHeaderUI: javax.swing.plaf.basic.BasicTableHeaderUI 
TableUI: javax.swing.plaf.basic.BasicTableUI 
TableHeader.ancestorInputMap: [email protected] 
Table.focusCellForeground: sun.swing.PrintColorUIResource[r=51,g=51,b=51] 
Table.gridColor: javax.swing.plaf.ColorUIResource[r=122,g=138,b=153] 
Table.descendingSortIcon: [email protected] 
Table.selectionForeground: sun.swing.PrintColorUIResource[r=51,g=51,b=51] 
Table.ancestorInputMap.RightToLeft: [email protected] 
Table.focusCellBackground: javax.swing.plaf.ColorUIResource[r=255,g=255,b=255] 
Table.scrollPaneBorder: [email protected] 
Table.ascendingSortIcon: [email protected] 
Table.sortIconColor: javax.swing.plaf.ColorUIResource[r=184,g=207,b=229] 
TableHeader.cellBorder: [email protected] 
Table.dropLineShortColor: sun.swing.PrintColorUIResource[r=51,g=51,b=51] 
Table.ancestorInputMap: [email protected] 
Table.selectionBackground: javax.swing.plaf.ColorUIResource[r=184,g=207,b=229] 
Table.foreground: sun.swing.PrintColorUIResource[r=51,g=51,b=51] 

*** Nimbus javax.swing.plaf.nimbus.NimbusLookAndFeel 1058 entries 
Table[Enabled+Selected].textForeground: DerivedColor(color=255,255,255 parent=nimbusLightBackground offsets=0.0,0.0,0.0,0 pColor=255,255,255 
TableHeader.disabledText: [email protected]e 
TableHeader:"TableHeader.renderer".contentMargins: javax.swing.plaf.InsetsUIResource[top=2,left=5,bottom=4,right=5] 
Table.font: [email protected]1 
TableHeader.disabled: [email protected]0 
TableHeader.rightAlignSortArrow: true 
TableHeaderUI: javax.swing.plaf.synth.SynthLookAndFeel 
TableHeader:"TableHeader.renderer"[MouseOver].backgroundPainter: [email protected] 
Table.disabled: [email protected]c 
Table.ancestorInputMap.RightToLeft: [email protected] 
TableHeader:"TableHeader.renderer"[Pressed].backgroundPainter: [email protected] 
Table.descendingSortIcon: [email protected] 
TableHeader:"TableHeader.renderer"[Disabled+Sorted].backgroundPainter: [email protected] 
TableHeader:"TableHeader.renderer"[Enabled+Focused].backgroundPainter: [email protected] 
Table.showGrid: false 
Table.ascendingSortIcon: [email protected] 
Table.rendererUseTableColors: true 
Table.contentMargins: javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0] 
Table.ancestorInputMap: [email protected] 
Table[Disabled+Selected].textBackground: DerivedColor(color=57,105,138 parent=nimbusSelectionBackground offsets=0.0,0.0,0.0,0 pColor=57,105,138 
TableHeader.opaque: true 
TableHeader:"TableHeader.renderer"[Disabled].backgroundPainter: [email protected] 
TableHeader.background: [email protected]6 
Table.scrollPaneCornerComponent: [email protected] 
TableHeader:"TableHeader.renderer"[Enabled+Focused+Sorted].backgroundPainter: [email protected] 
Table.disabledText: [email protected]9 
Table.focusCellHighlightBorder: [email protected] 
TableHeader:"TableHeader.renderer".States: Enabled,MouseOver,Pressed,Disabled,Focused,Selected,Sorted 
Table.dropLineShortColor: DerivedColor(color=191,98,4 parent=nimbusOrange offsets=0.0,0.0,0.0,0 pColor=191,98,4 
Table.background: DerivedColor(color=255,255,255 parent=nimbusLightBackground offsets=0.0,0.0,0.0,0 pColor=255,255,255 
TableHeader:"TableHeader.renderer"[Enabled+Sorted].backgroundPainter: [email protected] 
Table[Enabled+Selected].textBackground: DerivedColor(color=57,105,138 parent=nimbusSelectionBackground offsets=0.0,0.0,0.0,0 pColor=57,105,138 
Table.rendererUseUIBorder: true 
Table.textForeground: javax.swing.plaf.ColorUIResource[r=35,g=35,b=36] 
Table.dropLineColor: DerivedColor(color=115,164,209 parent=nimbusFocus offsets=0.0,0.0,0.0,0 pColor=115,164,209 
TableHeader.ancestorInputMap: javax.swing.UIDefaults$L[email protected] 
Table.intercellSpacing: javax.swing.plaf.DimensionUIResource[width=0,height=0] 
TableHeader:"TableHeader.renderer".Sorted: Sorted 
Table:"Table.cellRenderer".opaque: true 
TableHeader:"TableHeader.renderer"[Enabled].backgroundPainter: [email protected] 
Table.foreground: [email protected]2 
TableHeader:"TableHeader.renderer".opaque: true 
TableUI: javax.swing.plaf.synth.SynthLookAndFeel 
Table:"Table.cellRenderer".background: DerivedColor(color=255,255,255 parent=nimbusLightBackground offsets=0.0,0.0,0.0,0 pColor=255,255,255 
TableHeader.foreground: [email protected]1 
TableHeader.contentMargins: javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0] 
TableHeader[Enabled].ascendingSortIconPainter: [email protected] 
Table.cellNoFocusBorder: [email protected] 
TableHeader.font: [email protected]3 
Table:"Table.cellRenderer".contentMargins: javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0] 
Table.opaque: true 
Table.alternateRowColor: DerivedColor(color=242,242,242 parent=nimbusLightBackground offsets=0.0,0.0,-0.05098039,0 pColor=255,255,255 
TableHeader[Enabled].descendingSortIconPainter: [email protected] 

*** CDE/Motif com.sun.java.swing.plaf.motif.MotifLookAndFeel 553 entries 
Table.background: javax.swing.plaf.ColorUIResource[r=174,g=178,b=195] 
TableHeader.font: [email protected] 
TableHeader.focusCellBackground: javax.swing.plaf.ColorUIResource[r=255,g=247,b=233] 
Table.focusCellHighlightBorder: [email protected] 
TableHeader.foreground: javax.swing.plaf.ColorUIResource[r=0,g=0,b=0] 
Table.dropLineColor: javax.swing.plaf.ColorUIResource[r=99,g=101,b=111] 
Table.font: [email protected] 
TableHeader.background: javax.swing.plaf.ColorUIResource[r=174,g=178,b=195] 
TableHeaderUI: javax.swing.plaf.basic.BasicTableHeaderUI 
TableUI: javax.swing.plaf.basic.BasicTableUI 
TableHeader.ancestorInputMap: [email protected] 
Table.focusCellForeground: javax.swing.plaf.ColorUIResource[r=0,g=0,b=0] 
Table.gridColor: javax.swing.plaf.ColorUIResource[r=128,g=128,b=128] 
Table.descendingSortIcon: [email protected] 
Table.selectionForeground: javax.swing.plaf.ColorUIResource[r=255,g=247,b=233] 
Table.ancestorInputMap.RightToLeft: [email protected] 
Table.focusCellBackground: javax.swing.plaf.ColorUIResource[r=174,g=178,b=195] 
Table.ascendingSortIcon: [email protected] 
Table.sortIconColor: javax.swing.plaf.ColorUIResource[r=99,g=101,b=111] 
TableHeader.cellBorder: [email protected] 
Table.dropLineShortColor: javax.swing.plaf.ColorUIResource[r=178,g=77,b=122] 
Table.ancestorInputMap: [email protected] 
Table.selectionBackground: javax.swing.plaf.ColorUIResource[r=0,g=0,b=0] 
Table.foreground: javax.swing.plaf.ColorUIResource[r=0,g=0,b=0] 

*** Mac OS X com.apple.laf.AquaLookAndFeel 719 entries 
Table.selectionInactiveBackground: com.apple.laf.AquaImageFactory$SystemColorProxy[r=202,g=202,b=202] 
Table.focusCellForeground: com.apple.laf.AquaImageFactory$SystemColorProxy[r=164,g=205,b=255] 
Table.ancestorInputMap: [email protected] 
Table.selectionBackground: com.apple.laf.AquaImageFactory$SystemColorProxy[r=9,g=80,b=208] 
TableUI: com.apple.laf.AquaTableUI 
Table.foreground: javax.swing.plaf.ColorUIResource[r=0,g=0,b=0] 
Table.ancestorInputMap.RightToLeft: [email protected] 
Table.focusCellHighlightBorder: [email protected] 
Table.dropLineColor: javax.swing.plaf.ColorUIResource[r=142,g=142,b=142] 
Table.scrollPaneBorder: [email protected] 
Table.descendingSortIcon: [email protected] 
TableHeader.focusCellBackground: javax.swing.plaf.ColorUIResource[r=255,g=255,b=255] 
TableHeader.foreground: javax.swing.plaf.ColorUIResource[r=0,g=0,b=0] 
TableHeader.font: [email protected] 
Table.dropLineShortColor: javax.swing.plaf.ColorUIResource[r=0,g=0,b=0] 
TableHeaderUI: com.apple.laf.AquaTableHeaderUI 
Table.gridColor: javax.swing.plaf.ColorUIResource[r=255,g=255,b=255] 
Table.focusCellBackground: com.apple.laf.AquaImageFactory$SystemColorProxy[r=0,g=0,b=0] 
Table.selectionInactiveForeground: com.apple.laf.AquaImageFactory$SystemColorProxy[r=0,g=0,b=0] 
Table.font: [email protected] 
Table.background: javax.swing.plaf.ColorUIResource[r=255,g=255,b=255] 
Table.selectionForeground: com.apple.laf.AquaImageFactory$SystemColorProxy[r=255,g=255,b=255] 
TableHeader.cellBorder: [email protected] 
TableHeader.background: javax.swing.plaf.ColorUIResource[r=255,g=255,b=255] 
Table.ascendingSortIcon: [email protected] 
TableHeader.ancestorInputMap: [email protected] 
Table.sortIconColor: javax.swing.plaf.ColorUIResource[r=142,g=142,b=142]