d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > How Can You Integrate A Gui Inside A Website
Add Reply New Topic New Poll
Member
Posts: 5,988
Joined: May 6 2006
Gold: 30.00
Oct 29 2013 11:44am
I want to take a GUI that I already made and integrate it inside of a website..Is this possible?
Member
Posts: 2,757
Joined: Nov 26 2007
Gold: 1,214.81
Oct 29 2013 11:55am
You need to create a jar that contains your applet, then use the <applet> tag in your html.


YourApplet.java
Code
public class YourApplet extends JApplet {
public void init() {
JLabel label = new JLabel("Hello World!");
add(label);
}
}


put this in your html...
Code
<applet width="300" height="300" archive="YourApplet.jar"
code="com.YourPackage.YourApplet" />


Member
Posts: 2,757
Joined: Nov 26 2007
Gold: 1,214.81
Oct 29 2013 12:02pm
If you want to do rich web application development though, you need to use a web framework. You can find a list of them here http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Java
Member
Posts: 5,988
Joined: May 6 2006
Gold: 30.00
Oct 29 2013 05:10pm
Thanks for the two responses. First one looks simple enough, does it apply to other gui's as well (replace .jar with .exe)?

And as far as your second response, I am new to using the web for my apps, so I have no idea waht you mean by rich web development, can you briefly explain the pros and cons of rich web vs simple GUI apps?

This post was edited by oOn on Oct 29 2013 05:14pm
Member
Posts: 3,193
Joined: Apr 28 2010
Gold: 242.05
Oct 29 2013 09:54pm
Quote (oOn @ Oct 29 2013 06:10pm)
Thanks for the two responses. First one looks simple enough, does it apply to other gui's as well (replace .jar with .exe)?

And as far as your second response, I am new to using the web for my apps, so I have no idea waht you mean by rich web development, can you briefly explain the pros and cons of rich web vs simple GUI apps?


exe is not an archive file so no, you can do something like this if you dont want to make a jar file
Code

<applet code="yourprogram.class" width="500" height="500"></applet>
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 29 2013 10:19pm
Quote (oOn @ Oct 29 2013 07:10pm)
And as far as your second response, I am new to using the web for my apps, so I have no idea waht you mean by rich web development, can you briefly explain the pros and cons of rich web vs simple GUI apps?


you're confused because of terminology. you're using "simple GUI" to refer to java swing, i think, with plans of creating an applet. 99% of the time you dont want to do that. he's just telling you to avoid writing java applets if you intend to make a web app. you're welcome to use java (though i find it a bit tedious at times), but you'll have to use a java web framework and css to style them. which is completely different from what you're doing.

http://en.wikipedia.org/wiki/Java_Applet#Disadvantages

it's been years since i looked at it, but at the time GWT also allowed you to use swing and it'll convert it to javascript/html. you'll still have to modify your code to use it.

This post was edited by carteblanche on Oct 29 2013 10:21pm
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Oct 30 2013 04:11am
Quote (carteblanche @ Oct 29 2013 10:19pm)
you're confused because of terminology. you're using "simple GUI" to refer to java swing, i think, with plans of creating an applet. 99% of the time you dont want to do that. he's just telling you to avoid writing java applets if you intend to make a web app. you're welcome to use java (though i find it a bit tedious at times), but you'll have to use a java web framework and css to style them. which is completely different from what you're doing.

http://en.wikipedia.org/wiki/Java%5FApplet#Disadvantages

it's been years since i looked at it, but at the time GWT also allowed you to use swing and it'll convert it to javascript/html. you'll still have to modify your code to use it.


strongly recommend against using java for anything except backend for web dev
Member
Posts: 5,988
Joined: May 6 2006
Gold: 30.00
Oct 30 2013 09:18am
Quote (0n35 @ Oct 30 2013 10:11am)
strongly recommend against using java for anything except backend for web dev


Orly? What do you think of qtGUI?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 30 2013 10:20am
Quote (oOn @ Oct 30 2013 11:18am)
Orly? What do you think of qtGUI?


can you use that for web apps? i wasn't aware.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll