Home Answers Viewqa Swing-AWT Java Implementing Swing with Servlet

 
 


Bharathi
Java Implementing Swing with Servlet
1 Answer(s)      5 years and 4 months ago
Posted in : Swing AWT

How can i implement the swing with servlet in Java? Can anyone give an Example??

View Answers

February 26, 2008 at 5:45 PM



Implementing Swing with Servlet Example and source Code

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">; -->

<web-app>
<servlet>
<servlet-name>Servlet</servlet-name>
<servlet-class>SwingToServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Servlet</servlet-name>
<url-pattern>/SwingToServlet</url-pattern>

</servlet-mapping>
</web-app>

- - - - - - - - - - - - - -


import java.io.*;
import java.util.*;
import javax.swing.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class SwingToServlet extends HttpServlet {

public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException{
try {
JFrame frame = new JFrame("Frame in Java Swing");
frame.setSize(400, 400);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
catch(Exception e){
System.out.println(e);
}
}
}

Try it ;)
Amar









Related Pages:
java - Swing AWT
Java Implementing Swing with Servlet  How can i implement the swing with servlet in Java? Can anyone give an Example??   Implementing Swing with Servlet Example and source Code Servlet SwingToServlet
Implementing FTP in Java Code
Implementing FTP in Java Code  Hi, My job is to write a program in Java in my project. I have to implement FTP in my Java Code. Share me some of the code of Implementing FTP in Java Code. Thanks   Hi, Apache ftp
Source Code for Implementing Search Feature in JSP using Java action/Servlet - JSP-Servlet
Source Code for Implementing Search Feature in JSP using Java action/Servlet  How do I write the source code to implement search feature in JSP using Java action/servlet? My query is: SELECT @rownum:=@rownum+1 'rownum', X
implementing security - Security
implementing security  wanna learn cyptography in java...how must i proceed
Implementing voice commands
Implementing voice commands  Am trying to write a java program to implement voice commands within a windows platform using preferably java (though any language will do). I would be glad for any tips and procedures that would help
Source Code for Implementing Search Feature in JSF/JSP using Servlet - Java Beginners
Source Code for Implementing Search Feature in JSF/JSP using Servlet  ... Servlet?? Please advice using the example data below:- Thank You!! Employee... 01/01/2008 01/01/2008 14 Daisy BBB 01/01/2008 01/01/2008 using Servlet
SWING
SWING  A JAVA CODE OF MOVING TRAIN IN SWING
Source Code for Implementing Search Feature in JSP using Java Action/Servlet - JSP-Interview Questions
Source Code for Implementing Search Feature in JSP using Java Action/Servlet  How do I write the source code to implement search feature in JSP using Java action/servlet? (java action is the priority, but servlet is OK) My
implementing DAO - Struts
implementing DAO  Hi Java gurus I am pure beginner in java, and have to catch up with all java's complicated theories in a month for exam. Now... appreciated! Thanks virgo25  Hi friend, Java DAO Implementation
Java - Swing AWT
Java  program to read,add,update,delete the database using swing and servlet
swing
swing  Write a java swing program to delete a selected record from a table
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
Implementing a SoftReference based HashMap - Java Tutorial
Implementing a SoftReference based HashMap 2001-03-28 The Java Specialists' Newsletter [Issue 015] - Implementing a SoftReference based HashMap Author... either via email or RSS. Welcome to the 15th issue of "The Java(tm
Exception handling in super and subclass while implementing inheritance,,?
Exception handling in super and subclass while implementing inheritance,,?  How to implement Superclass Exceptions with SubClass while implementing Inheritance concept in core java.? Please answer for this with sample code
Sorting data in a jsp using a servlet while implementing comparable - JSP-Servlet
Sorting data in a jsp using a servlet while implementing comparable  ... which is stored in the session scope of a servlet. Below is its code...) { this.price = price; } } Then there is a controller servlet bellow: /* * To change
Threads in Java Swing MVC Application
Threads in Java Swing MVC Application  Hello, I am currently making a Java Swing application, but I am having a lot of trouble with implementing threads into my program. I use the MVC paradigm and I just can't seem to implement
JSP Project: implementing video chatting in JSP
JSP Project: implementing video chatting in JSP  Hi!!! I am developing a chatting application in JSP and Servlet. I want to implement video chatting facility on my website. How can I do this task. Please help at the earliest
Implementing ArrayList's functionalities into arrays - Java Beginners
Implementing ArrayList's functionalities into arrays  Hi guys, i'm trying to solve an exercise were is asked to write a program that manages the grades of a list of students (given by the exercise) for one single exam; The list
Java - Swing AWT
Java  write a servlet program to create a form which accept user information and find the number of visit to the page  Use this concept, to find how many times this page is accessed by users ublic class
implementing an algorithm using multi threads - Java Beginners
implementing an algorithm using multi threads  Hi i need to implement an algorith in multi threads.Algorithm has data dependency so i need to pass data from one thread to another thread. I am posting my algorithm which needs
JAVA SWING JTabbedPane - Java Beginners
JAVA SWING JTabbedPane  Hi all, I would like to ask a question... = makeTextPanel("Java, Servlet JSP Struts2.0 "); tabbedPane.addTab("Three", icon... = makeTextPanel("Java Tutorial"); tabbedPane.addTab("One", icon, panel1, "Does
java swing - Swing AWT
java swing  how i can insert multiple cive me exampleolumn and row in one JList in swing?plz g  Hi Friend, Please clarify your question. Thanks
Java swing
Java swing  what are the root classes of all classes in swing
Java swing
Java swing  Does Swing contains any heavy weight component
java swing
java swing  view the book details using swing
java swing
java swing  what is java swing   Swing is a principal GUI toolkit for the Java programming language. It is a part of the JFC (Java Foundation Classes), which is an API for providing a graphical user interface for Java
java swing
java swing  how to connect database with in grid view in java swing   Hi Friend, Please visit the following link: Grid view in java swing Thanks
java swing - Swing AWT
java swing  how to add image in JPanel in Swing?  Hi Friend, Try the following code: import java.awt.*; import java.awt.image....: http://www.roseindia.net/java/example/java/swing/ Thanks
java swing
java swing  add two integer variables and display the sum of them using java swing
Java swing
Java swing  Write a java swing program to calculate the age from given date of birth
java swing - Swing AWT
java swing   how i can insert in JFrame in swing?  Hi Friend, Try the following code: import java.awt.*; import javax.swing.*; import java.awt.event.*; class FormDemo extends JFrame { JButton ADD; JPanel
java swing - Swing AWT
java swing   Iam developing a java web browser.Actually my code works fine ie. i can load a web page without proxy.But in my place i have only proxy... a proxy or how to make my java web browser to listen to proxy setting??? please help
java swing.
java swing.  Hi How SetBounds is used in java programs.The values in the setBounds refer to what? ie for example setBounds(30,30,30,30) and in that the four 30's refer to what
What is Java Swing?
What is Java Swing?       Here, you will know about the Java swing. The Java Swing provides... and GUIs components. All Java Swing classes imports form the import
Java swing
are displayed in the table..I need the source code in java swing...Java swing  If i am login to open my account the textfield,textarea and button are displayed. if i am entering the time of the textfield
Java swing
to the database using java swing...Java swing  I create one table. That table contains task ID and Task Name. When I click the task ID one more table will be open and that table
B+ tree JAVA source code for implementing Insertion and Deletion - Java Beginners
B+ tree JAVA source code for implementing Insertion and Deletion  Can anyone plz mail de B+ tree JAVA source code for implementing Insertion and Deletion..Its urgent   Hi friend, public class BinarytreeDemo
java swing - Swing AWT
java swing  how to save data in sql 2005 while insert in textfield  Hi Friend, Try the following code: import java.sql.*; import javax.swing.*; import javax.swing.border.*; import java.awt.*; import
java - Swing AWT
What is Java Swing AWT  What is Java Swing AWT
Java swing
Java swing  how to create simple addition program using java swing?   import java.awt.*; import javax.swing.*; import java.awt.event.*; class SumOfNumbers extends JFrame { SumOfNumbers(){ JLabel lab1=new
swing - Java Beginners
Swing application testing  What are the conventions for testing a Java swing application
Swing Program
Swing Program  Write a java swing program to calculate the age from given date of birth
Swing paint - Swing AWT
the Swing Applet, use html file with the following code: Java Applet Demo...Swing paint  hi, i want to print something on window using swing applet.. m doing dis.. protected void paintComponent(Graphics g
Java swing
Java swing  when i enter the time into the textbox and activities into the textarea the datas saved into the database.the java swing code for the above item   import java.sql.*; import java.awt.*; import javax.swing.
java - Servlet Interview Questions
java  Which interface or class is implementing or extending ServletContext interface
Java swing
Java swing  How to combine two java files
java swing
java swing  meaning of out.flush
java swing
java swing  what is code for diplay on java swing internal frame form MYSQL DB pls send   Here is a code of creating form on jinternalframe and connect to mysql. import java.io.*; import java.sql.*; import java.awt.
swing program
swing program  Write a java swing program to getname and email id. Display the message if email id contains the name of theuser