Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

mouseover drop down menu  RSS feed

 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone tell how to make a drop down menu which scrolls down when mouse is moved over it using java as generally they are made using javascript.
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jeevansai jinne wrote:generally they are made using javascript.


Not generally. Commonly in web applications.

You can use a MouseListener or MouseMotionListener to achieve this. Can you be a little bit more clear what exactly you want?
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want a menu that opens when mouse pointer moves over it without the need for clicking it.By the way can i use java to make gui stuff in webpages.
 
Campbell Ritchie
Sheriff
Posts: 55324
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Stephan says: maybe you can use a mouse motion listener and open the menu when the mouse enters the component. Careful, though. If you have too many drop down menus appearing as you move the mouse around, the display will be very difficult to use.
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a MouseListener to a JMenu that invokes the JMenu.doClick() method on a mouseEntered() event.

You can write web app GUIs in Java using GWT, but personally I'm not a big fan of it. I prefer to use HTML and CSS directly, and use an MVC web framework that supports templating.
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any disadvantage of using java in webpages i don't see java in any webpage code everywhere javascript is present
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is not run in browsers directly (anymore). There are client-side languages such as ActionScript, Flash, Silverlight, etc., but JavaScript is the most common.
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now would you suggest me to use java or learn some other language
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For web applications? I'm a firm believer of MVC frameworks, and Java has a couple of really good ones, such as Spring MVC. It still means that you will need to know at least CSS and HTML, and JavaScript is always good to know.
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will the frameworks run directly without any plugin
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The frameworks run server-side. The only thing that 'runs' client-side would be JavaScript, and you can do a lot of fancy effects with just CSS instead.
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so you mean java runs client-side but it's frameworks run server-side but how
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Java runs server-side. Java is only run client-side in the form of desktop applications.
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why plugin is needed if java runs serverside
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I never said you needed a plugin.
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But java plugin is needed to view applets
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, and Applets are old technology that should not be used anymore. Java is used server-side, usually with frameworks, to serve web pages, that may or may not be enhanced with JavaScript on the client-side.
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i do all the things done by applet with server-side java
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't promise you can do *everything*, but you can do a lot. Maybe for some specific things you might need some client-side scripting.
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my browser needs java plugin for playing any video or add in any webpage
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need Java to play videos in your browser in general. HTML5 can do all of this.
 
jeevansai jinne
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is play framework good
 
Stephan van Hulst
Saloon Keeper
Posts: 7706
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can make an online game with videos completely in Java on the server-side, without resorting to browser plugins. All you need is Java with a web framework, CSS3 and HTML5.

[edit]

I don't know. I've only used Jersey and Spring so far.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!