• Post Reply Bookmark Topic Watch Topic
  • New Topic

Does swing run on server or client side or both side?

 
mohammad shadab
Ranch Hand
Posts: 52
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

One of my friend have been asked this question in an interview.he asked me regarding this,i could give answer him is that swing runs on client side .could you please have look on this.

Thank You.
 
Campbell Ritchie
Marshal
Posts: 52565
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect the correct answer is neither. You usually use Swing for desktop apps.

But interview questions are different from ordinary questions. It is not so much what you answer as how you answer.
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:I suspect the correct answer is neither. You usually use Swing for desktop apps.

But interview questions are different from ordinary questions. It is not so much what you answer as how you answer.


My perennial problem. Sometimes you fail if you're not ignorant enough.

Swing is not a client/server architecture. The UI is on the same system as the application.

Now for the part where ignorance is bliss.

That's true of Swing per se, but a lot of systems are running Unix or Linux and using the X windowing system. Unlike vanilla Microsoft Windows, under X, the UI can be on a different machine than the application, with the communications between the two being done via TCP port 6000.

In X, the UI machine - a/k/a the user's Desktop - is considered to be the server and the application machine (with the Swing code on it) is considered as the client. Which confuses a lot of people, since one normally considers the "server" to be "the machine where the logic is performed". But that's X for you.

The actual UI rendering and input tracking is not being done by Swing, it's being done by X, and the application's graphics rendering code is likewise rendered through X. Windows does have somewhat the same concept, minus the networking part.

What makes this significant is that Sun owned not only Java, but also the Solaris Unix operating system, so they did set up the lower levels with this understanding in mind, while still keeping to the "write once/run anywhere" philosophy that keeps it from breaking under Windows. There is, in fact a "headless" option to the Java graphics subsystem that web applications often take advantage of when generating graphics, as part of the rendering process does consist of outsourcing abstract graphics functions to the video card.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!