web link in option dialog


hi:
How can I put a web link, so that the user can click on it and to to the web sit, in a JOptionDialog
I tried to put html code, but it doesn't show in the dialog

Posted On: Tuesday 23rd of October 2012 11:38:04 PM Total Views:  280
View Complete with Replies

RELATED TOPICS OF Swing / AWT / SWT PROGRAMMING LANGUAGE




How to link JComboBox item with a webpage

, I wanted to ask how to link JComboBox item with a webpage....to be more specific, say if i have inserted a drop-down menu bar in my GUI, so what i was thinking was how to open a webpage whose opening is triggered by the selection of an item of that drop-down menu bar. It would be really helpful for you all to contribute useful answers..
VIEWS ON THIS POST

67

Posted on:

Wednesday 26th September 2012
View Replies!

linking two jpanels

i am working a desktop application,in which i am having a jpanel which is a login page,what i want is to move to other jpanel on successful login .
VIEWS ON THIS POST

130

Posted on:

Wednesday 17th October 2012
View Replies!

Dragging ftp-link to windows explorer - which dataflavor?

I need to drag a file link (ftp://localhost/foo.zip) to the windows explorer, making it download the file. I'm using: new DataFlavor("text/uri-list;class=java.lang.String");
VIEWS ON THIS POST

108

Posted on:

Wednesday 17th October 2012
View Replies!

Is it possible to simply change the optionType label in JOptionPane

Hi all I am aware of possibility to have an array of objects (usually Strings) as the parameter options, so we can have buttons with custom labels. Is there any easier way to just for example change the value of OK_OPTION option button label/text from "ok" to "okAy"
VIEWS ON THIS POST

84

Posted on:

Wednesday 17th October 2012
View Replies!

Not able to open links from JEditorPane

I have added html page in JEditorPane. html page has some links. When I open those links independantly i.e directly from html page then links are get opened. but now I have added HTML page in JEditorPane. & from here links are not get opened. & getting IOException........ java.net.ConnectException: Connection timed out: connect Following is the code I have written for this. Please check & give me appropriate solution. i.e. Why I am not able to open links from JEditorPane. import java.awt.BorderLayout; import java.io.FileNotFoundException; import java.io.IOException; import java.net.URL; import java.util.Map; import javax.swing.JDialog; import javax.swing.JEditorPane; import javax.swing.JScrollPane; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import com.mmi.commonlib.ConstantClass; import com.mmi.log.service.LogController; import com.mmi.resourcemgt.ScreenResourceManager; import com.mmi.security.service.SecurityManager; class test { public JEditorPane htmlPane = null; test() { JDialog objDialog = new JDialog(); objDialog.setTitle("Acknowledments"); String attrubutionPath = "com/mmi/help/Attributions_en.html"; URL url = ClassLoader.getSystemClassLoader().getResource(attrubutionPath); System.out.println("AttributionScreen.AttributionScreen() " + url); try { htmlPane = new JEditorPane(url); objDialog.getContentPane().add(new JScrollPane(htmlPane)); htmlPane = new JEditorPane(url); htmlPane.setFont(ConstantClass.T3FONT); htmlPane.setEditable(false); htmlPane.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { System.out.println("Link clicked.........."); try { System.out.println("event.getURL() :"+event.getURL()); htmlPane.setPage(event.getURL()); } catch (IOException e) { System.out.println("IOException........"); e.printStackTrace(); } } } }); JScrollPane scrollPane = new JScrollPane(htmlPane); objDialog.getContentPane().add(scrollPane, BorderLayout.CENTER); } catch (Exception ioe) { System.err.println("Error displaying " + url); } objDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); objDialog.setSize(600, 500); objDialog.setResizable(true); objDialog.setVisible(true); } public static void main(String[] args) { new test(); } }
VIEWS ON THIS POST

88

Posted on:

Wednesday 17th October 2012
View Replies!

Eclipse's AbstractTextEditor - making links "alive"

Hi I have a basic class i've written extending AbstractTextEditor. I use it only to display text files, not to edit them. I want that when the text contains links (or paths like /usr/bin/mydir) - they will be clickable and i can control what happens when user clicks on them. If they can be drawn in another color, it's even better. How can I do that
VIEWS ON THIS POST

85

Posted on:

Wednesday 17th October 2012
View Replies!

j option pane

I am thinking of using this joption pane that I saw on Sun's website. Is this easy to use, manipulate, etc...
VIEWS ON THIS POST

59

Posted on:

Wednesday 17th October 2012
View Replies!

HTML hyperlinks in SWT

Does anyone know if there is a way to format normal text to HTML in SWT. What I am trying to achieve is that I want to have a link in the text but I can't use the HyperlinkClass since the text will need to be translated.
VIEWS ON THIS POST

105

Posted on:

Wednesday 17th October 2012
View Replies!

how to set hyperlink to JTree leaf nodes?

hi to all,i want to set hyperlink to JTree leaf nodes.what finnally i want is, when i place a mouse on leaf node text, hand symbol has to come.After selecting that particular node,i need to call a JDioalog having content of that selected node. Any one please help me....
VIEWS ON THIS POST

84

Posted on:

Wednesday 17th October 2012
View Replies!

hyperlink and StyledText(SWT) control

Howto create hyperlink into StyledText swt-control Is it possible 10x
VIEWS ON THIS POST

82

Posted on:

Thursday 18th October 2012
View Replies!

swt hyperlink

can anybody please tell me with an example how to provide hyperlink text using SWT.I mean on clicking the text it goes to web page, i got idea of using html,it worked ...but its nopt working when other components are used in SWT.
VIEWS ON THIS POST

107

Posted on:

Thursday 18th October 2012
View Replies!

hyperlink in JTable

is it possible to convert the data in JTable as a hyperlink.....
VIEWS ON THIS POST

81

Posted on:

Thursday 18th October 2012
View Replies!

Working on a JList and giving it more options?

Read the JLIst API and follow the link to the section in the Swing tutorial on "How to Use Lists" for a working example that allows you to add/remove items from a JList.
VIEWS ON THIS POST

92

Posted on:

Sunday 21st October 2012
View Replies!

How prevent the user closing the Joptionpane by clicking the X in the right end corner

The requirement is if the user clicks the X in JOptionpane it should not close. In JDialog we have setDefaultCloseOperation but i am not sure what is the functionality that we have to implement in JoptionPane similar to the setDefaultCloseOperation. optionsConfirm[0] = new String(EJbundle.getString("YES")); optionsConfirm[1] = new String(EJbundle.getString("NO")); int answer = JOptionPane.showOptionDialog() if (answer== JOptionPane.YES_OPTION) { } if (answer == JOptionPane.CLOSED_OPTION) { If the user click the X button of the JOPTIONPANE it should not close. I know that setdefaultclose operation was in JDialog. But i am not sure how the same/alternative can be implemented in JOptionPane }
VIEWS ON THIS POST

80

Posted on:

Monday 22nd October 2012
View Replies!

how to add find option

I created a tool for log viewing. I am using JTextPane for the output display. I want to add a find next menu option (like F3 option in ultraedit) , is there any code example for this
VIEWS ON THIS POST

65

Posted on:

Monday 22nd October 2012
View Replies!

Problem in getting the link to open in Internet explorer

Hi all I have a label. I have written mouse listeners for this link. That is when i click on this link www.google.com has to be opened in Internet Explorer. I need some suggestions or code templates.
VIEWS ON THIS POST

64

Posted on:

Monday 22nd October 2012
View Replies!

link from swing page to swing page

I have a problem i have a JFrame with two panel and one menu from menu i choose tipe of grafics and for every grafic i have a diferent opshan in my opshan panel i wont to mace samtinc like link When i choos grafic one opshan panel to have component 1 or 2 and when i choose grafic 2 to appear to have diferent component in my panel Tenck before [ September 04, 2008: Message edited by: mixo TODOR ]
VIEWS ON THIS POST

71

Posted on:

Monday 22nd October 2012
View Replies!

How to make hyperlink to openup in browser and e-mail link in e-mail client

I have one requirement to put a website address and e-mail address in a dialog, showing them like hyperlinks. Say like adding hyperlink in JLabel. 1. new JLabel(""+"http://www.javaranch.com"+ ""); 2. new JLabel(""+"support@somemail.com"+ ""); In 1) when we click on hyper link it should open up website in clients default browser. I would be able to do this by adding label to a button or just hyperlink text to button and writing code in actionPerformed method. Is there any other easy way in API. In 2) When clicked on e-mail hyperlink, it should open up in e-mail client, showing e-mail in to field of e-mail client. For example, it should open up outlook and it should be like new message with to field filled with "support@somemail.com ". Hint: Goto START->RUN-> type in run field "msimn.exe support@somemail.com" This works if you have outlook installed in your system. But it opens outlook, not the new message with TO field filled with e-mail address mentioned. I don't know how to implement this in code for my swing application. Can any body know how to do this
VIEWS ON THIS POST

83

Posted on:

Monday 22nd October 2012
View Replies!

how to create hyperlink from java

dear friends i need to create an hyperlink in my Swing page. on clicking the hyperlink i have to link to file specified. is it possible from java to create an hyperlink. if possible, please help me.
VIEWS ON THIS POST

90

Posted on:

Tuesday 23rd October 2012
View Replies!

how to blink the Jframe title bar

daer , i am amit working on j2ee/swing technology and developing a chat server. i have the same problem which u have faced probably i.e. the problem of blinking jframe title bar. actually i have acrossed the same problem and its very very imp plz help me, i would be very thankful to you. my problem is that i want my Jframe title bar blinking(when it is minimized) as soon as this window gets a new message. hopeing for your positive response. regards amit
VIEWS ON THIS POST

77

Posted on:

Tuesday 23rd October 2012
View Replies!