当前位置: 首页>>代码示例>>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;未经允许,请勿转载。