Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Using text and a progress bar inside of a tooltip.

802561Mar 25 2011 — edited Mar 25 2011
Hi,

I'm trying to get my tool tip to appear as: "Percentage: progressBar," but am not sure how to do so. I've made it so that the progress bar shows up with help from some users on this forum, but am not sure how to use text with it. Here is what I have:
import java.awt.Dimension;
import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JToolTip;
import javax.swing.JProgressBar;

public class ToolTip {

	private JFrame frame;
	
	private JButton button;
	
	private JToolTip testToolTip;

	private JProgressBar progressBar;

	public static void main(String[] var) {
		new ToolTip();
	}

	public ToolTip() {
		progressBar = new JProgressBar(0, 100);
		progressBar.setValue(5);
		progressBar.setStringPainted(true);
        
		testToolTip = new JToolTip() {
			{
				setLayout(new BorderLayout());
				add(progressBar);
			}

			@Override
			public Dimension getPreferredSize() {
				return new Dimension(150, 20);
			}
		};

		button = new JButton("herp") {
			
			@Override
			public JToolTip createToolTip() {
				return testToolTip;
			}
			
		};
		button.setToolTipText("A");
		
		frame = new JFrame("derp");
		frame.setSize(100, 100);
		frame.getContentPane().add(button);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}

}
Re-reading this I'm not so sure my point will get across, so pretty much what I want is something that would be implementing a JLabel and JProgressBar inside the same tool tip, having the label and progress bar showing themselves in their respectful way.
This post has been answered by kleopatra-JavaNet on Mar 25 2011
Jump to Answer

Comments

Sudipto Desmukh

Any ideas guys?

Sandeep Kumar sk

I know that this file ObAccessClient.xml.lck is generated when webserver starts. One should not delete this lck file for a running server. You may delete this file only after stopping the server. This file is used by webgate.

The httpd.pid file is used the running webserver. So don't delete these two files. At least I am sure about these two files should not be deleted for a running webserver. After webserver server is stopped the file ObAccessClient.xml.lck  can be deleted. The size of this file ObAccessClient.xml.lck is 0 bytes (I think so...)

Sudipto Desmukh

Thanks, i'm aware of these. But this still doesn't explain the OHS crash, I can understand why OHS won't start when these files are not present, but weird that OHS would crash hours after the cronjob has deleted these files.

Sandeep Kumar sk

Hi Sudipto,

Here is explaination why httpd.pid file is required for a running http server. http://chestofbooks.com/computers/webservers/apache/Stas-Bekman/Practical-mod_perl/5-3-3-Finding-the-Right-Apache-PID.html#.VOaXn5jF_q1

The http server from Oracle is derived from Apache server and when Apache server starts it writes its pid into this file. When any signal needs to be sent to this process (process being the httpd daemon process), the pid of the process should be known- this is available from the httpd.pid file. Hence the presence of this file is required during the lifetime of a running httpd server. If this file is missing/deleted then there is no way to contact the httpd daemon process- since the pid is not known.

Also I have noticed few times when httpd server has an issue due to resources or not started properly etc the presence of this file from a previous running httpd server causes issues during starting of fresh httpd server. I had to delete the httpd.pid file for the zombie httpd server in order to restart http server.

I have also noticed similar behavior with ObAccessclient.xml.lck file. These .lck files are lock files which provide the server process read/write locks. Hence these are required during the runtime of the http server process/webgate. Also sometimes when http server has issues or needs to be restarted one needs to delete this .lck file from the previous run. I think if the http server is shutdown gracefully this file should get deleted automatically but sometimes this file exists then it causes issues with restarting http server.

Here is a blog which cautions not to delete the lck files (similar to the 4 files you posted)Chuni Lal Kukreja OAM, OIM, Webgate,Active Directory,SharePoint 2013,IIS7.5,OAAM Blog: Lock Files in OAM 11g R2PS2

Hope this helps. Please mark the answer as solved/helpful if it resolves your issue.

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 22 2011
Added on Mar 25 2011
2 comments
954 views