java swing settooltiptext_Java JPanel.setToolTipText方法代码示例

import javax.swing.JPanel; //导入方法依赖的package包/类

/**

* This method creates a so called dead end. This means that originally a class

* should be displayed which was already displayed on a higher level in direction

* to the root node. This was realized to prevent the form generation to be run

* in an endless loop.

*

* @param oscsd the oscsd

* @param className the class name

* @param depth the depth

* @param pan the pan

* @param node the node

*/

private void createOuterDeadEnd(OntologySingleClassSlotDescription oscsd, String className, int depth, JPanel pan, DefaultMutableTreeNode node){

// --- this outer element has no parents which are inner classes

// --- so its added to the mainPanel

final JPanel dataPanel = new JPanel();

dataPanel.setLayout(null);

dataPanel.setToolTipText(oscsd.getSlotName() + "-Panel");

// --- add a JLabel to display the field's name

JLabel valueFieldText = new JLabel();

valueFieldText.setText("" + oscsd.getSlotName() + " ["+oscsd.getSlotVarType()+"] - " + Language.translate("Zyklisch !") + "");

valueFieldText.setBounds(new Rectangle(0, 4, 330, 16));

// --- add both GUI elements to the panel

dataPanel.add(valueFieldText, null);

this.setPanelBounds(dataPanel);

DynType dynType = new DynType(oscsd, DynType.typeCyclic, className, dataPanel, oscsd.getSlotName(), null);

node.add(new DefaultMutableTreeNode(dynType));

// --- set the new position (increment the height) for the parent panel of the

// --- newly created panel

Rectangle pos = dataPanel.getBounds();

pos.x = 10;//tiefe * einrueckungProUntereEbene;

pos.y = pan.getHeight();

dataPanel.setBounds(pos);

pan.add(dataPanel);

this.setPanelBounds(pan);

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值