Welcome to Dream.In.Code
Getting Java Help is Easy!

Join 132,637 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,066 people online right now. Registration is fast and FREE... Join Now!




Java Applet Help - Covert Text URL into clickable links

 
Reply to this topicStart new topic

Java Applet Help - Covert Text URL into clickable links

devonator
post 12 Oct, 2008 - 02:12 AM
Post #1


New D.I.C Head

*
Joined: 6 Sep, 2008
Posts: 43


My Contributions


ok heres what i got so far... It creates a gui on webpages...
now how do i convert text files into clickable links in the window?
eg. i paste in:
http://www.1.com
http://www.2.com
in the same text field and get a html page that displays
those text as clickable links?


CODE



import java.io.*;
import java.awt.*;
import java.applet.*;
import java.net.*;

import javax.swing.*;



public class LinkConverter extends Applet {

Button getL;
TextField input;

CheckboxGroup radioGroup;

Checkbox browser;
Checkbox save;

public void init() {


setLayout(null);

getL = new Button("Convert");
input = new TextField("");
radioGroup = new CheckboxGroup();

browser = new Checkbox("Open in Browser", radioGroup, true);
save = new Checkbox("Save as .html", radioGroup, false);

input.setBounds(20, 70, 100, 40);
browser.setBounds(20, 120, 100, 30);
save.setBounds(140,120,100,30);
getL.setBounds(20, 170, 100,30);

add(input);
add(browser);
add(save);
add(getL);


}

}


User is offlineProfile CardPM

Go to the top of the page

William_Wilson
post 12 Oct, 2008 - 05:45 AM
Post #2


lost in compilation

Group Icon
Joined: 23 Dec, 2005
Posts: 3,970



Thanked 15 times

Dream Kudos: 3275

Expert In: Java, C, Javascript

My Contributions


Never done it myself, but with a document listener on the input to catch it, this tutorial makes it seem fairly straightforward.
User is offlineProfile CardPM

Go to the top of the page

devonator
post 12 Oct, 2008 - 11:57 PM
Post #3


New D.I.C Head

*
Joined: 6 Sep, 2008
Posts: 43


My Contributions


thnx very much sir!
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 04:17AM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month