當前位置: 首頁>>代碼示例>>Java>>正文


Java JList.setBackground方法代碼示例

本文整理匯總了Java中javax.swing.JList.setBackground方法的典型用法代碼示例。如果您正苦於以下問題:Java JList.setBackground方法的具體用法?Java JList.setBackground怎麽用?Java JList.setBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JList的用法示例。


在下文中一共展示了JList.setBackground方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ScrollBivariatePanel

import javax.swing.JList; //導入方法依賴的package包/類
public ScrollBivariatePanel(JWatBivariateStatsTable table) {
	tab = table;
	setViewportView(tab);
	ListModel lm = new AbstractListModel() {

		private static final long serialVersionUID = 1L;

		String headers[] = ((JWatBivariateStatsTableModel) tab.getModel()).getNames();

		public int getSize() {
			return headers.length;
		}

		public Object getElementAt(int index) {
			return headers[index];
		}

	};
	JList rowHeader = new JList(lm);
	rowHeader.setBackground(getBackground());
	rowHeader.setFixedCellWidth(100);
	rowHeader.setFixedCellHeight(tab.getRowHeight());
	rowHeader.setCellRenderer(new RowHeaderRenderer(tab));
	setRowHeaderView(rowHeader);
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:26,代碼來源:ScrollBivariatePanel.java

示例2: setNames

import javax.swing.JList; //導入方法依賴的package包/類
public void setNames() {
	ListModel lm = new AbstractListModel() {

		private static final long serialVersionUID = 1L;

		String headers[] = ((JWatBivariateStatsTableModel) tab.getModel()).getNames();

		public int getSize() {
			return headers.length;
		}

		public Object getElementAt(int index) {
			return headers[index];
		}

	};
	JList rowHeader = new JList(lm);
	rowHeader.setBackground(getBackground());
	rowHeader.setFixedCellWidth(100);
	rowHeader.setFixedCellHeight(tab.getRowHeight());
	rowHeader.setCellRenderer(new RowHeaderRenderer(tab));
	setRowHeaderView(rowHeader);
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:24,代碼來源:ScrollBivariatePanel.java

示例3: setNames

import javax.swing.JList; //導入方法依賴的package包/類
public void setNames() {
	ListModel lm = new AbstractListModel() {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
		String headers[] = ((JWatBivariateStatsTableModel) tab.getModel()).getNames();

		public int getSize() {
			return headers.length;
		}

		public Object getElementAt(int index) {
			return headers[index];
		}
	};
	JList rowHeader = new JList(lm);
	rowHeader.setBackground(getBackground());
	rowHeader.setFixedCellWidth(100);
	rowHeader.setFixedCellHeight(tab.getRowHeight());

	rowHeader.setCellRenderer(new RowHeaderRenderer(tab));

	setRowHeaderView(rowHeader);
}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:26,代碼來源:ScrollBivariatePanel.java

示例4: createNewConfigurableJList

import javax.swing.JList; //導入方法依賴的package包/類
/**
 * Creates a new JList for a given source of a configurable
 *
 * @param source
 *            can be null for local configurables, otherwise name of the source
 * @return the created JList
 */
private JList<Configurable> createNewConfigurableJList(String source) {

	final JList<Configurable> createdConfigList = new JList<>();
	createdConfigList.setModel(source == null ? localConfigListModel : remoteConfigListModels.get(source));
	createdConfigList.setCellRenderer(new ConfigurableRenderer());
	createdConfigList.setFixedCellHeight(40);
	createdConfigList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	createdConfigList.setBackground(LIGHTER_GRAY);

	return createdConfigList;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:19,代碼來源:ConfigurableDialog.java

示例5: createNewInfoLabelJList

import javax.swing.JList; //導入方法依賴的package包/類
/**
 * Creates a new JList for info labels of a source
 *
 * @param source
 *            can be null for local source, otherwise name of the source
 * @return the created JList
 */
private JList<String> createNewInfoLabelJList(String source) {
	final JList<String> createdInfoLabelList = new JList<>();
	createdInfoLabelList.setModel(source == null ? localInfoLabelListModel : remoteInfoLabelListModels.get(source));
	createdInfoLabelList.setCellRenderer(new ConfigurableInfoLabelRenderer());
	createdInfoLabelList.setFixedCellHeight(20);
	createdInfoLabelList.setBackground(LIGHTER_GRAY);
	return createdInfoLabelList;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:16,代碼來源:ConfigurableDialog.java

示例6: initListModel

import javax.swing.JList; //導入方法依賴的package包/類
/**
 * 初始化數據庫表列表的數據模型
 */
@SuppressWarnings("unchecked")
public void initListModel()
{
    JList<String> v_Tables = (JList<String>)XJava.getObject("xlTables");
    
    this.listModel = new DefaultListModel<String>();
    
    v_Tables.setModel(this.listModel);
    v_Tables.setBackground(this.getBackground());
}
 
開發者ID:HY-ZhengWei,項目名稱:HBaseClient,代碼行數:14,代碼來源:AppFrame.java

示例7: ScrollBivariatePanel

import javax.swing.JList; //導入方法依賴的package包/類
public ScrollBivariatePanel(JWatBivariateStatsTable table) {
	tab = table;
	setViewportView(tab);
	ListModel lm = new AbstractListModel() {
		/**
		* 
		*/
		private static final long serialVersionUID = 1L;
		String headers[] = ((JWatBivariateStatsTableModel) tab.getModel()).getNames();

		public int getSize() {
			return headers.length;
		}

		public Object getElementAt(int index) {
			return headers[index];
		}
	};
	JList rowHeader = new JList(lm);
	rowHeader.setBackground(getBackground());
	rowHeader.setFixedCellWidth(100);
	rowHeader.setFixedCellHeight(tab.getRowHeight());

	rowHeader.setCellRenderer(new RowHeaderRenderer(tab));

	setRowHeaderView(rowHeader);
}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:28,代碼來源:ScrollBivariatePanel.java

示例8: getEntryArea

import javax.swing.JList; //導入方法依賴的package包/類
/** Lazily creates and returns the panel. */
private JList<SelectableListEntry> getEntryArea() {
    if (this.entryArea == null) {
        JList<SelectableListEntry> result = this.entryArea = new JList<>();
        result.setBackground(getColors().getBackground(Mode.NONE));
        result.setForeground(getColors().getForeground(Mode.NONE));
        result.setSelectionBackground(getColors().getBackground(Mode.FOCUSED));
        result.setSelectionForeground(getColors().getBackground(Mode.FOCUSED));
        result.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        result.setCellRenderer(new CellRenderer());
    }
    return this.entryArea;
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:14,代碼來源:ListPanel.java

示例9: formatList

import javax.swing.JList; //導入方法依賴的package包/類
/**
 * Sets the desired look of the list.
 * 
 * @param list
 *            List to apply style to.
 */
default void formatList(JList<?> list) {
	list.setBackground(Color.decode(getTheme().listBackground));
}
 
開發者ID:Col-E,項目名稱:Recaf,代碼行數:10,代碼來源:RenderFormatter.java


注:本文中的javax.swing.JList.setBackground方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。