javax.swing.JProgressBar#setToolTipText ( )源码实例Demo

下面列出了javax.swing.JProgressBar#setToolTipText ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: pgptool   文件: CreateKeyView.java
private JPanel buildPanelButtons() {
	JPanel whole = new JPanel(new BorderLayout());

	progressBar = new JProgressBar(0, 100);
	progressBar.setToolTipText(Messages.text("phrase.generatingYourSecureKey"));
	progressBar.setIndeterminate(true);

	JPanel btns = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
	btns.setBorder(BorderFactory.createEmptyBorder(5, 10, 10, 10));
	btns.add(progressBar);
	btns.add(new JLabel("  "));
	btns.add(btnCreate = new JButton());
	btns.add(btnCancel = new JButton());
	whole.add(btns, BorderLayout.EAST);

	return whole;
}
 
@Override
public Component getListCellRendererComponent(JList<? extends SpecialAttribute> list, SpecialAttribute item, int index, boolean isSelected, boolean cellHasFocus) {
	JPanel panel = JPanelFactory.createBorderlessPanel();
	panel.setToolTipText(item.getLongDescription());
	panel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
	
	JLabel lblItem = JLabelFactory.createJLabel(item.getDescription());
	lblItem.setBounds(3, 13, 80, 20);
	lblItem.setToolTipText(item.getLongDescription());
	panel.add(lblItem);
	
	JProgressBar itemProgressBar = JProgressBarFactory.createHorizontalJProgressBar(0, item.getMaxValue(), imageInfoReader);
	itemProgressBar.setBounds(120, 13, 110, 20);
	itemProgressBar.setValue(item.getCurrentValue());
	itemProgressBar.setToolTipText(item.getLongDescription());
	panel.add(itemProgressBar);
	
	return panel;
}
 
源代码3 项目: WorldGrower   文件: CommunityDialog.java
private void createDeitiesPanel(World world, int infoPanelWidth, int infoPanelHeight, JPanel infoPanel) {
	JPanel deitiesPanel = JPanelFactory.createJPanel("Deities");
	deitiesPanel.setLayout(null);
	deitiesPanel.setBounds(510, 363, infoPanelWidth + 5, infoPanelHeight);
	infoPanel.add(deitiesPanel, DEITIES_KEY);
	
	DeityAttributes deityAttributes = GroupPropertyUtils.getVillagersOrganization(world).getProperty(Constants.DEITY_ATTRIBUTES);
	String deityTooltip = "deity hapiness indicator: if a deity becomes unhappy, they may lash out against the population";
	
	for(int i=0; i<Deity.ALL_DEITIES.size(); i++) {
		Deity deity = Deity.ALL_DEITIES.get(i);
		Image image = imageInfoReader.getImage(deity.getBoonImageId(), null);
		JLabel nameLabel = JLabelFactory.createJLabel(deity.getName(), image);
		nameLabel.setBounds(15, 30 + 40 * i, 150, 50);
		nameLabel.setHorizontalAlignment(SwingConstants.LEFT);
		nameLabel.setToolTipText(deityTooltip);
		deitiesPanel.add(nameLabel);
		
		JProgressBar relationshipProgresBar = JProgressBarFactory.createHorizontalJProgressBar(deityAttributes.getMinHapinessValue(), deityAttributes.getMaxHapinessValue(), imageInfoReader);
		relationshipProgresBar.setBounds(175, 40 + 40 * i, 300, 30);
		relationshipProgresBar.setValue(deityAttributes.getHappiness(deity));
		relationshipProgresBar.setToolTipText(deityTooltip);
		deitiesPanel.add(relationshipProgresBar);
	}
}
 
源代码4 项目: WorldGrower   文件: CharacterDialog.java
private void createSkillBlock(SkillProperty skillProperty, JPanel parentPanel, int x, int y) {
	
	String skillDescription = skillProperty.getName();
	skillDescription = Character.toUpperCase(skillDescription.charAt(0)) + skillDescription.substring(1);
	JLabel lblSkill = JLabelFactory.createJLabel(skillDescription);
	lblSkill.setBounds(x, y, 110, 20);
	lblSkill.setToolTipText(skillProperty.getLongDescription());
	parentPanel.add(lblSkill);
	
	JLabel lblSkillValue = JLabelFactory.createJLabel(playerCharacter.getProperty(skillProperty).toString());
	lblSkillValue.setBounds(x + 115, y, 15, 20);
	lblSkillValue.setToolTipText(skillProperty.getLongDescription());
	parentPanel.add(lblSkillValue);
	
	JProgressBar skillProgressBar = JProgressBarFactory.createHorizontalJProgressBar(0, 100, imageInfoReader);
	skillProgressBar.setBounds(x + 130, y, 130, 20);
	skillProgressBar.setToolTipText(skillProperty.getLongDescription());
	skillProgressBar.setValue(playerCharacter.getProperty(skillProperty).getPercentageUntilNextLevelUp());
	parentPanel.add(skillProgressBar);
}
 
源代码5 项目: MtgDesktopCompanion   文件: JVMemoryPanel.java
public JVMemoryPanel() {
	setLayout(new BorderLayout(0, 0));
	progressBar = new JProgressBar();
	progressBar.setMinimum(0);
	progressBar.setMaximum(toMB(Runtime.getRuntime().totalMemory()));
	progressBar.setStringPainted(true);
	progressBar.setToolTipText(tooltip);
	add(progressBar);
	defaultBack = progressBar.getBackground();
	defaultFront = progressBar.getForeground();
	refresh();
}
 
源代码6 项目: jaamsim   文件: GUIFrame.java
private void addRunProgress(JToolBar mainToolBar, Insets margin) {
	progressBar = new JProgressBar( 0, 100 );
	progressBar.setPreferredSize( new Dimension( 120, controlRealTime.getPreferredSize().height ) );
	progressBar.setValue( 0 );
	progressBar.setStringPainted( true );
	progressBar.setToolTipText(formatToolTip("Run Progress",
			"Percent of the present simulation run that has been completed."));
	mainToolBar.add( progressBar );
}
 
源代码7 项目: Spade   文件: MemoryWatcher.java
public MemoryWatcher()
{
	// Create the progressbar that is to be used as memory state display.
	PB = new JProgressBar(0, 100);
	PB.setStringPainted(true);
	PB.addMouseListener(new MouseAdapter()
	{
		public void mousePressed(MouseEvent e)
		{
			System.gc();
		}
	});
	PB.setToolTipText("<html><body><b>Memory Display</b><br>Display's the state of the memory in the Application.<br>Click to run the Garbage-Collector</body></html>");
	
	// Add Progressbar to this JPanel
	this.add(PB, BorderLayout.CENTER);
	this.setBackground(PaintCanvas.TRANSPARENT);
	
	// Create the Memory-Watcher Thread
	THIS = new Thread(this);
	THIS.setDaemon(true);
	THIS.setName("MemoryWatcherThread");
	
	// Get the Runtime object.
	RUNTIME = Runtime.getRuntime();
	
	// Start the watcher-thread!
	THIS.start();
}