Make a href="" clickable in labels/messages?

Is it possible to add a click-sensitive URL in a message dialog?
I add HTML formatted text as the message via JOptionPane.showMessageDialog(). adding "<a href=" tags are rendered correctly (they are displayed blue and underlined) but nothing happens when i click in this "link" ... of course(?).
is it possible to make such a link "click-sensitive" so that the user can click on this link in the dialog and the URL is opened in the browser (or at least in a Java component capabale of displaying HTML web sites)?

This is definitely not the end solution to your problem, but maybe somewhat atleast....
Btw, if possible I'd like to see the code you use to make an url link.
package pax.ui.resources;
import java.io.IOException;
* A class to execute an URL in a browser.
* Under Unix, the system browser is hard-coded to be 'netscape'.
* Netscape must be in your PATH for this to work. This has been
* tested with the following platforms: AIX, HP-UX and Solaris.
* Under Windows, this will bring up the default browser under Windows,
* usually either Netscape or Microsoft IE. The default browser is
* determined by the OS. This has been tested under Windows 95/98/NT/XP.
* Used as: PaxBrowserControl.executeURL("url");
* Note: It's a must to include the url type, either "http://" or "file://".
* Code written by Unknown, edited by Martin Ulfvik, aka Paximir.
public class PaxBrowserControl
     // Used to identify the Windows platform.
private static final String WIN_ID = "Windows";
// The default browser under Windows.
private static final String WIN_PATH = "rundll32";
// The flag to display an url under Windows.
private static final String WIN_FLAG = "url.dll,FileProtocolHandler";
// The default browser under Unix.
private static final String UNIX_PATH = "netscape";
// The flag to display an url under Unix.
private static final String UNIX_FLAG = "-remote openURL";
     * Tries to run a given argument, (String url),
     * as an adress in an open or new browser.
public static void executeURL(String aURL)
     Process process;
String cmd = null;
String os = System.getProperty("os.name");
try     
     // Checks if the operating system is Windows.
if(os != null && os.startsWith(WIN_ID))
cmd = WIN_PATH + " " + WIN_FLAG + " " + aURL;
process = Runtime.getRuntime().exec(cmd);
else
// Under Unix, Netscape has to be running for the "-remote"
// command to work. So, we try sending the command and
// check for an exit value. If the exit command is 0,
// it worked, otherwise we need to start the browser.
cmd = UNIX_PATH + " " + UNIX_FLAG + "(" + aURL + ")";
process = Runtime.getRuntime().exec(cmd);
try
// Waits for exit code and checks if the command worked.
// 0 = worked. If its not 0 startup of browser is neededed,
if(process.waitFor() != 0)
cmd = UNIX_PATH + " " + aURL;
process = Runtime.getRuntime().exec(cmd);
catch(InterruptedException aInterruptedException)
System.err.println("Error bringing up browser, command=" + cmd);
System.err.println("Caught: " + aInterruptedException);
// When a browser could not be executed.
catch(IOException aIOException)
System.err.println("Could not invoke a browser, command=" + cmd);
System.err.println("Caught: " + aIOException);
     // End of executeURL(String).
     // End of class PaxBrowserControl.
     * Main method for Debugging and Testing purposes.
     * Just paste the method into the PaxBrowserControl class and uncomment it.
/*     public static void main(String args[])
          // Runs the url "http://java.sun.com" in an open or new browser.
          executeURL("http://java.sun.com");
          // End of method main(String).

Similar Messages

  • How to make a div clickable and still be w3c compliant

    Can someone help me to make a div clickable so it is still w3c compliant?This is my current div and it seems to work, but when I check for compliance I get "unexpected end tag (a not expected). ???
    <div id="pic-wrapper">
    <a href="../index.htm"><div id="pic"></div></a></div>
    Appreciate any help. Thank you.

    This is something I've never needed to do mysefl, but it ought to work ok.  And do not remove your standard a tag with its link currenlty inside the div so Search Engines will be able to spider the link and users without javascript will be able to reach it as well.  I've added the code in orange:
    <div id="pic-wrapper" onclick="location.href='http://www.yourwebsite.com/index.htm';" style="cursor: pointer;">
    <a href="../index.htm"><div id="pic"></div></a></div>
    I just guessed your link was to the homepage, so that is what I replicated in orange, but of course you would be sure to change the link to the correct absolute address.
    Let us know how this works for you.
    E. Michael Brandt
    www.divahtml.com
    www.divahtml.com/products/scripts_dreamweaver_extensions.php
    Standards-compliant scripts and Dreamweaver Extensions
    www.valleywebdesigns.com/vwd_Vdw.asp
    JustSo PictureWindow
    JustSo PhotoAlbum, et alia

  • How can I make a rule to mark all messages sent to Mail Trash as Read?

    How can I make a rule to mark all messages sent to Mail Trash as Read?
    When I look at some emails on my phone, I can see from the title that I don't need to read the email so I delete it without opening it. When I go to my Macbook Pro and open mail, the number of unread messages in my Trash shows next to the name. It drives me nuts. Can I just set a rule to mark all messages sent to trash as read? If that isn't possible, I'd take just making the number not show beside the Trash folder.

    Just in the case that I actually do need to go back to them for some reason. I have some OCD tendencies which is also why the number beside the folder drives me nuts.

  • How to make form fields "Clickable"

    Hey Guys,
    I created a Fillable PDF Form with Form fields using ADOBE Acrobat 9.0 Pro-Ex + LiveCycle Designer for Windows XP.
    My question is when you create a form, is there a way to make form fields "clickable" instead of just auto-tab? Because if you mess up when filling out the form, you don't want to have to tab through the whole document just to get back to that spot. How can i fix that?
    My other question is, when printing the form, the form field "text boxes" always show up. Is there a way to hide the boxes and just print the form without them. (The information that was filled in will still show, just the outline of the boxes won't?)
    Thanks a bunch,
    Joseph

    Unfortunately I don't know enough about Designer to tell you what you did to make the boxes unclickable, but for me I've never had an issue doing that.
    However, I can tell you what you need to do to get rid of the boxes around each of your text fields.
    1. In design mode, select the field(s) you wish to get rid of the borders on. (If all you have are text fields, you can press Ctrl+A to select all fields. If not, you can hold down the Ctrl button while left-clicking each field to change all text fields at once.)
    2. Open the Object window (Shift+F7 toggles this on and off). Find the option for Appearance.
    3. Click the drop down menu next to Appearance and choose none.
    4. The borders will now be gone from the text fields.

  • How do make the text on a label Bold?

    Simple question: How do make the text on a label Bold?

    use html : label.setText("<html><body><b>TestText</b></body>/html>");
    regards,
    Tim

  • HT4009 Whenever I go to make an in-app purchase, a message pops up saying "this is not a test user account." What does that mean and how can I get rid of it so I can purchase things?

    Whenever I go to make an in-app purchase, a message pops up saying "this is not a test user account." What does that mean and how can I get rid of it so I can purchase things?

    Try a soft-reset and see if it works after your phone has restarted (it seems ot have fixed the error for a number of people on here) : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the equivalent of a reboot.

  • How to make shape objects clickable/selectable in transformgroups in java 3

    I am building a visualizer program that has Java 3D components inside Swing components. I have a branchgroup inside a canvas3d inside a simpleuniverse, which is added to a JTabbedPane. Inside the branchgroup I have multiple transformgroups each with one shape in them (box, cone, sphere, cylinder). Each transformgroup has the ability to rotate, zoom, and tranlate objects because I have incorperated a MouseZoom, MouseRotate, and MouseTranslate object as from the Java 3D library functions (these are applied to each transformgroup every time one is created and added to the branchgroup). My problem is that I am trying to make these shapes clickable/sectable/dragable/dropable on the screen - currently when I try to translate ONE object all the shapes move on the screen and I cannot get just one shape to move (all shapes move when I only want one to). How do I make only one shape move when it is clicked?
    I know the question is kind of out there and specific so if anyone knows how to generically give transformgroups/shapes drag and drop properties that would also help a great deal. Does anyone know how to to this? Thanks a ton.

    shape uses the contains and intersects methods, is that what you need? Without code it is hard to guess what is required.

  • How to make add the program system.out messages to a applet text field?

    How to make add the program system.out messages to a applet text field?
    System.out.println("I wanna displany this message on a applet text field, thanks");

    You may wish to change the output destination to a JTextArea. Please have a look at this link that likely shows what you want:
    [http://forums.sun.com/thread.jspa?forumID=54&threadID=640376|http://forums.sun.com/thread.jspa?forumID=54&threadID=640376]
    If you need other examples, search the forum. I found the search terms -- redirect system out textarea -- very helpful.
    Good luck

  • I get an error message while converting the file. you do not have the privilege to make changes. I get this message when I try to import a music CD

    I get an error message while converting the file. you do not have the privilege to make changes. I get this message when I try to import a music CD

    Hey amba1015,
    I found an article that talks about similar error messages in relation to importing an audio CD. Check out the recommended troubleshooting steps in here to see if they help:
    Trouble adding music to iTunes library or importing audio CD
    http://support.apple.com/kb/TS1387
    Welcome to Apple Support Communities!
    Have a good one,
    Delgadoh

  • I bought a second 4s, when i try to make new ID, there is a message comes:cannot sign in the maximum number of free accounts have been activated on this iPhone, is there any way to solve this problem?

    i bought a second 4s, when i try to make new ID, there is a message comes:cannot sign in the maximum number of free accounts have been activated on this iPhone, is there any way to solve this problem?

    Sure. You can do it on a Mac at the following website: https://appleid.apple.com/account

  • When I try to make an in-app purchase, this message appears: "This is not a Test User account. Please create a new account in the Sandbox environment"

    When I try to make an in-app purchase, this message appears: "This is not a Test User account. Please create a new account in the Sandbox environment"

    Common on jailbroken iPhones, not so on non-jailbroken iPhones. Thus, if your phone is not jailbroken, restoring from backup will hopefully fix the issue.

  • How to make a DKIM signature for outgoing messages in Thunderbird (SMTP-server does not support DKIM)?

    SMTP-server does not support DKIM signature.
    How to make a DKIM signature for outgoing messages in the Thunderbird?

    I'm not familiar with this particular use of the terminology.
    Thunderbird has S/MIME support built in. You can add PGP support via the Enigmail add-on. Both offer the means to sign and encrypt messages.
    I see add-ons to support the checking of DKIM-signed incoming messages, but haven't found any yet for signing.
    Is it something that an email client is entitled to do? The Wikipædia entry says
    <blockquote>Both modules, signing and verifying, are usually part of a mail transfer agent (MTA).</blockquote>
    and that means a server, as opposed to a client (MUA).

  • How can I change the margin settings in the pages inspector to make them more specific for label templates. I need margins that can be set to hundreths of a centimetre not just tenths.

    How can I change the margin settings in the pages inspector to make them more specific for label templates. I need margins that can be set to hundreths of a centimetre not just tenths.

    I doubt you need hundreths as you would not even be able to measure that and the printer doesn't hold the paper to those tolerances.
    fruhulda is right. Pages accepts higher measure but rounds it in the measure field.
    If you want absolute accuarcy you need to set your measures to points. Everything else is being recalculated.
    Peter

  • How to make a sphere clickable

    Hi guys,
    I've been programming in Java for a while, and am very new to Java3D. I have the code below which displays a simple sphere in a box. I have some things I'd like to do but am unsure of how to go about them.
    import com.sun.j3d.utils.geometry.*;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import com.sun.j3d.utils.behaviors.mouse.MouseWheelZoom;
    import java.awt.event.*;
    import java.awt.event.WindowAdapter;
    import java.awt.*;
    public class prototype1 {
    public prototype1() {
    SimpleUniverse universe = new SimpleUniverse();
    BranchGroup group = new BranchGroup();
    Sphere sphere = new Sphere(0.5f);
    TransformGroup maing = new TransformGroup();
    maing.addChild(sphere);
       group.addChild(maing);
       Color3f light1Color = new Color3f(1.8f, 0.1f, 0.1f);
       BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
       Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);
       DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
       light1.setInfluencingBounds(bounds);
       group.addChild(light1);
       universe.getViewingPlatform().setNominalViewingTransform();
       universe.addBranchGraph(group);
    public static void main(String[] args) { new prototype1(); }
    }The first thing I cannot do is figure out how to resize the window that the sphere appears in.
    The second thing I cannot do is to make the sphere clickable, so that when you click on it a simple System.out.println occurs. I have looked around and found a group.setPickable(true); sort of statement, can this be applied here? Or is a better method to have a button over the sphere and make it invisible? Or is there some way to detect the co-ordinates of the panel that have been clicked? If anyone has any ideas or can point me towards some good tutorials that would be fanatastic,
    Thanks
    Beccy

    Hi!
    Right have figured out the first problem by myself!
    This is my code so far:
    import com.sun.j3d.utils.geometry.*;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.swing.BoxLayout;
    import javax.swing.JFrame;
    import javax.vecmath.*;
    import com.sun.j3d.utils.behaviors.mouse.MouseWheelZoom;
    import java.awt.event.*;
    import java.awt.*;
    public class prototype1 {
    public prototype1() {
         JFrame.setDefaultLookAndFeelDecorated(true);
         JFrame frame = new JFrame("Prototype Visualisation");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         Panel canvasPanel = new Panel();
         canvasPanel.setLayout(new BoxLayout(canvasPanel, BoxLayout.Y_AXIS));
         GraphicsConfiguration config = SimpleUniverse
                .getPreferredConfiguration();
         Canvas3D canvas = new Canvas3D(config);
         canvas.setSize(700,450);
         canvasPanel.add(canvas);
         frame.add(canvasPanel);
         frame.pack();
         frame.setVisible(true);
       SimpleUniverse universe = new SimpleUniverse(canvas);
       BranchGroup group = new BranchGroup();
       Sphere sphere = new Sphere(0.1f);
       sphere.setPickable(true);
       TransformGroup maing = new TransformGroup();
       maing.addChild(sphere);
       group.addChild(maing);
       Color3f light1Color = new Color3f(1.8f, 0.1f, 0.1f);
       BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
       Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);
       DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
       light1.setInfluencingBounds(bounds);
       group.addChild(light1);
       //group.setPickable(true);
       universe.getViewingPlatform().setNominalViewingTransform();
       //TransformGroup cameraTransform = universe.getViewingPlatform().getViewPlatformTransform();
       //cameraTransform.setTransform(getCameraTransform(5.0));
       // add the group of objects to the Universe
       universe.addBranchGraph(group);
    public static void main(String[] args) { new prototype1(); }
    }

  • I'm on vodafone but can't make or receive calls, but viber, messages and Internet work perfectly. Any ideas?

    I'm on Vodafone, but can't make or receive calls. Viber, messaging and the Internet work fine. I've an iPhone 4. Any ideas?

    Did you activate roaming before going abroad?
    Click on EE & ME and where it says My Account, click on Devices and Usage and enable it from there, cllick on EE & ME and where it says travel and shopping click on using phone abroad.
    http://ee.co.uk/help/add-ons-benefits-and-plans/call-or-going-abroad/roaming---using-your-phone-abroad/using-4g-abroad

Maybe you are looking for

  • Pros/cons of using iPod as backup HD?

    Ok, I'm the last person on the planet without an iPod, but thinking of getting one. I'm wondering if I can get away with using an iPod for both music and as my backup HD (instead of using an external FW HD) for my primary HD (this would get me halfwa

  • ALE Configuration Conceptual Questions

    Hi Experts, I need some help regarding the ALE configurations. 1. I know that we specify the RFC dest in the port and then specify the port in partner profile. What exactly is the significance of a port in case of outbound Scenario? we could have dir

  • MenuBar - Submenu Indicator

    I've gone over the Spry sample menubar code carefully and I just don't see how this all works. In the samples, whenever a menu has a submenu there is a black indicator present. On mouse over, the black indicator changes to white. In my code, I get th

  • Crystal Reports 10 - Cannot make new report

    I am having problems creating a report in Crystal Reports 10. I have the same settings in the OBDC as another machine. Theirs is working properly. I can refresh but cannot create a new report. We are currently connected to the AS/400 system. Thanks M

  • Stateless EJB as CORBA callback objects

    I am trying to have an EJB working as a client of an external CORBA system that provides an asynchronous interface. This means the EJB has to provide the CORBA server with a Callback object implementing a particular CORBA interface. I'd like to have