It is JavaScript, not Java. Java is something different.
You are still asking for two different things in my mind, and both can be
achieved using the insert html code fragment tool in Publisher to insert
some javascript code into your Publisher web page. The possibilities and
variety of free code snippets are easy to find. Just google "javascript
menus", javascript drop down boxes", "DHTML menus", "fly out menus", etc...
Once you find a code snippet that seems to do what you want it to do, then
just try it, insert it into your page and see if it both works, and gives
you what you want. If it doesn't, modify it or delete it and try a different
snippet.
Here is just one example of a drop down box. Just copy and paste it into a
code fragment box, and try it. If that is what you want, then edit the
*.html links to point to either another page on your site, or an external
site. If you need help in understanding how to modify this code snippet, the
URL for where it came from is included. And this is just one example of the
zillion free code snippets available.
----------
<Script language="JavaScript">
<!-- Script courtesy of
http://www.web-source.net - Your Guide to
Professional Web Site Design and Development
function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != "0") {
location=form.select.options[index].value;}}
//-->
</SCRIPT>
<FORM NAME="form1">
<SELECT NAME="select" ONCHANGE="goto(this.form)" SIZE="1">
<OPTION VALUE="">-------Choose a Selection-------
<OPTION VALUE="index.htm">Home
<OPTION VALUE="web_development.htm">Web Development
<OPTION VALUE="html_codes.htm">HTML Tips
<OPTION VALUE="html_codes_chart.htm">HTML Code Chart
<OPTION VALUE="javascript_codes.htm">JavaScript Codes
<OPTION VALUE="216_color_chart.htm">Color Code Chart</SELECT>
</FORM>
----------
Enjoy yourself.
DavidF