• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing design possible to integrate with servlet

 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i new to swing i going to create button in swing is it possible to integrate with servlet.please help me
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "integrating a Swing button with a servlet"? What exactly are you trying to do???
 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, thanks for yr reply i have servlet code its shows ringing status.i going to put button using swing based on the ringing status button color must change
it is possible.
 
Campbell Ritchie
Marshal
Posts: 52565
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried the setBackground() method? That allows colour changing.

Probably more appropriate to have this discussion on the Swing forum.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't use Swing code in servlets. Servlets run on the server, and whatever GUI they create will be shown on the server's monitor - where in all likelihood nobody is watching.
 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, thanks for yr reply. Is it possible to integrate applet code into servlet code please help me
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Applets are a special form of Swing code that runs inside of a browser. You can't use them in a servlet.

The servlet (or a JSP) can generate an HTML page that includes an applet, which will then run in the client's browser, though. It doesn't sound like that's what you're trying to do, though.

So it seems that you're on the wrong track. What is it you're actually trying to accomplish?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by saravanan rajendran:
hi, thanks for yr reply i have servlet code its shows ringing status.i going to put button using swing based on the ringing status button color must change
it is possible.


When you are saying that the servlet code shows a status, I'm assuming that the servlet generates a HTML page that is shown in the user's browser and shows the status there.

If that's the case, the button needs to be a HTML button, too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!