当前位置: 首页>>代码示例>>Java>>正文


Java JTable.getRowHeight方法代码示例

本文整理汇总了Java中javax.swing.JTable.getRowHeight方法的典型用法代码示例。如果您正苦于以下问题:Java JTable.getRowHeight方法的具体用法?Java JTable.getRowHeight怎么用?Java JTable.getRowHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JTable的用法示例。


在下文中一共展示了JTable.getRowHeight方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import javax.swing.JTable; //导入方法依赖的package包/类
void update(MapRule rule,JTable table,int row){
	this.rule=rule;
	int rowHeight=50;
	int h=table.getRowHeight(row);
	if(h!=rowHeight){
		table.setRowHeight(row, rowHeight);
	}
	String name=rule.getName();
	if(name==null){
		name="无";
	}else if(name.trim().equals("")){
		name="无";
	}
	label_wan_address.setText("名称: "+rule.name+"  加速端口: "+rule.dst_port);
	label2.setText("本地端口: "+rule.getListen_port());

}
 
开发者ID:jonasxiao,项目名称:FinalSpeed,代码行数:18,代码来源:MapRuleRender.java

示例2: configureRowHeight

import javax.swing.JTable; //导入方法依赖的package包/类
public static void configureRowHeight(JTable table) {
    int height = table.getRowHeight();
    Font cellFont = UIManager.getFont("TextField.font");
    if (cellFont != null) {
        FontMetrics metrics = table.getFontMetrics(cellFont);
        if (metrics != null) {
            height = metrics.getHeight() + 2;
        }
    }
    table.setRowHeight(Math.max(table.getRowHeight(), height));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:UiUtils.java

示例3: getTableCellEditorComponent

import javax.swing.JTable; //导入方法依赖的package包/类
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
	
	this.table = table;
	this.row = row;
	this.column = column;
	this.originalRowHeight = table.getRowHeight(row);
	this.confirmationKey = KeyEvent.VK_UNDEFINED;
	
	table.setRowHeight(row, (int) (originalRowHeight*1.5));
	return this.getEditorComponent(value);
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:13,代码来源:BasicCellEditor.java

示例4: getTableCellRendererComponent

import javax.swing.JTable; //导入方法依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    setText(value.toString());
    setSize(table.getColumnModel().getColumn(column).getWidth(), getPreferredSize().height);
    if (table.getRowHeight(row) != getPreferredSize().height) {
        table.setRowHeight(row, getPreferredSize().height);
    }
    return this;
}
 
开发者ID:TigerNguyen19,项目名称:JapaneseAnalysis,代码行数:9,代码来源:WordWrapCellRenderer.java

示例5: getTableCellRendererComponent

import javax.swing.JTable; //导入方法依赖的package包/类
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
		boolean isSelected, boolean hasFocus, int row, int column) 
{		
	TreeMap<Effect, Double> map = brain.getValueMapAt(row, column);		
	
	if (map == null) 
	{
		// set Background of first two cells (which only show health and
		// object of interaction)

		Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
		cell.setBackground(this.getColorByRow(table, row));			
		
		return cell;
	} 
	else
	{	
		if(map.size()*15 > table.getRowHeight(row))
			table.setRowHeight(row, map.size()*15);
		
		// print effect in grey-tone which corresponds with its probability
		// (the darker the writing, the more probable the effect)

		JLabel ret = new JLabel();
		
		// open html; contains the effect in its particular grey
		String s = "<html>";

		// iterate over the different observed effects
		// example: energy increase and object destruction can appear after
		// one action
		for (Entry<Effect, Double> entry : map.entrySet()) 
		{

			// get probability of the effect from brain
			float probability = (float) entry.getValue().doubleValue();

			// create grey-tone corresponding to probability
			String hexColor = createHexaColor(probability);

			// add effect in corresponding color to the string
			s += "<font color=" + hexColor + ">"
					+ entry.getKey().toString() + "<br>"+ "</font>";
		}
		s += "</html>"; // close html-
		ret.setText(s);

		// make background of ret (JLabel) visible
		//ret.setOpaque(true);					
		
		//ret.setBackground(this.getColorByRow(table, row));
		
		return ret;
	}

}
 
开发者ID:CognitiveModeling,项目名称:BrainControl,代码行数:58,代码来源:BrainTableRenderer.java


注:本文中的javax.swing.JTable.getRowHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。