Problem with submenu
can anyone please help me over how to write submenu code in struts.
Can you please expand your problem a little bit. If you are talking about javascript menus, then it has nothing to do with Struts. You can find a lot of ready to use scripts to create menus like here ...
Similar Messages
-
SpryMenuBar, problems with Submenu
Hi, everyone,
I am new to Spry widgets. I am working with CS5.
I have a problem with the only submenu I want to have for this site (in French). Instead of explaining, I attached a grab. My problme is clearly showing: the border of the submenu is offset on the left.
How can I fixed that? I went through all possible styles and could not find anything.
As well, when there are submenus, there generally appear a triangle on the right hand side of my menu to indicate that there is a submenu. How can I disable that?
Thanks a lot for any suggestion!
BrunoFirst off, upgrade to Spry version 1.6.1 as per here.
Then replace the red coloured value to something that suits your menu
ul.MenuBarHorizontal ul
margin: 0;
padding: 0;
list-style-type: none;
font-size: 10px;
font-weight: normal;
z-index: 1020;
cursor: default;
width: 48em;
position: absolute;
left: -1000em;
something like 8em.
Lastly, you have a problem on line 56 of your code which has no relation to Spry.
I hope this helps.
Ben -
Xcode problem with submenu highlighted item
This stuff works in Xcode 3.2 on my 10.6 Air, but not on Xcode 3.1.4 / on my Imac (10.5.8). This code is in an IBAction method that is connected to the menu via IB.
[[mySubMenu highlightedItem] setState:NSOnState]; // ignored, state is not changed.
// or
[[mySubMenu highlightedItem] tag]; // always returns 0 regardless of actual (int)tag.
// but this works fine
[[mySubMenu itemWithTag:myTag)] setState:NSOnState]; // the tag is read properly here, state is changed.
I was assuming that highlightedItem meant "selected item". Is highlightedItem the usual way to detect a menu event ? What is wrong ?Because you have inline (via the admin) added sizes etc you will see it created inline code. Even switching to a type (CSS HTML ONLY is the one you want) to have a raw html output to CSS style it as you wish you need to go into each menu item and remove any of the style configurations and dimension sizes you added.
-
Problems with displaying submenues
Hi
I made a site with submenues, but the titles are all cramped up. How to correct this?
The first item should read "How to find ICC" and the second one is "Contact us", but a bid hard to read
Thanks
UlfThanks a lot, Vivek.
Here is a bigger screenshot:
Btw. I tries to make a menu on another site and just made a few subpages, "untitled-xxx" and it worked just fine in "preview site", so I guess it is related to this site only. Maybe I should try and make a new master page?
Ulf -
Having problem with spry menu bar in Internet Explorer.
I'm having a problem with my spry menu bars in Internet Explorer.
Here are the pictures:
Firefox
Internet Explorer
HERE ARE THE CODES:
HTML CODE:
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
width:160px;
height:126px;
z-index:1;
left: 205px;
top: 424px;
margin: 0 auto;
-->
</style>
<style type="text/css">
#apDiv3 {
position:absolute;
width:254px;
height:206px;
z-index:2;
left: 123px;
top: 1529px;
#apDiv4 {
position:absolute;
width:250px;
height:194px;
z-index:3;
left: 381px;
top: 1528px;
#apDiv5 {
position:absolute;
width:256px;
height:200px;
z-index:4;
left: 636px;
top: 1529px;
#apDiv6 {
position:absolute;
width:349px;
height:205px;
z-index:5;
left: 889px;
top: 1530px;
</style>
<style type="text/css">
#apDiv7 {
position:absolute;
width:887px;
height:204px;
z-index:6;
left: 324px;
top: 905px;
#apDiv8 {
position:absolute;
width:1295px;
height:74px;
z-index:1;
left: 212px;
top: 668px;
</style>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
</script>
<style type="text/css">
#apDiv2 {
position:absolute;
width:209px;
height:197px;
z-index:2;
top: 1220px;
left: 171px;
#apDiv9 {
position:absolute;
width:331px;
height:97px;
z-index:3;
left: 385px;
top: 1218px;
#apDiv10 {
position:absolute;
width:292px;
height:199px;
z-index:4;
left: 724px;
top: 1218px;
#apDiv11 {
position:absolute;
width:200px;
height:115px;
z-index:1;
body {
background-color: #000;
background-image: url();
text-align: center;
color: #F00;
.none {
font-size: 80px;
font-family: "Times New Roman", Times, serif;
font-weight: bold;
#apDiv12 {
position:absolute;
width:991px;
height:60px;
z-index:5;
left: 198px;
top: 192px;
#apDiv13 {
position:absolute;
width:200px;
height:115px;
z-index:1;
left: 588px;
top: 322px;
</style>
<body onLoad="MM_preloadImages('images/WebConfroll.png','images/youthfootballroll.png','images/ statefbsweatshirt.png')">
<p align="center" class="none"><img src="images/footballtitle.png" width="941" height="183"></p>
<div align="center">
<ul id="MenuBar2" class="MenuBarHorizontal">
<li><a class="MenuBarItemSubmenu" href="#">[Placeholder]</a>
<ul>
<li><a href="#">[Placeholder]</a></li>
<li><a href="#">[Placeholder]</a></li>
<li><a href="#">[Placeholder]</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">[Placeholder]</a>
<ul>
<li><a href="#">[Placeholder]</a></li>
<li><a href="#">[Placeholder]</a></li>
<li><a href="#">[Placeholder]</a></li>
</ul>
</li>
<li><a class="MenuBarItemSubmenu" href="#">Videos</a>
<ul>
<li><a class="MenuBarItemSubmenu" href="#">2008 Videos</a>
<ul>
<li><a href="videos/2009 videos/Glenbard part one/partone.html">Glenbard South Game</a></li>
<li><a href="#">             &# 160;         [Placeholder]</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">2009 Videos</a>
<ul>
<li><a href="#">[Placeholder]</a></li>
<li><a href="#">[Placeholder]</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">2010 Videos</a>
<ul>
<li><a href="#">[Placeholder]</a></li>
<li><a href="#">[Placeholder]</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><span class="cent"><img src="images/bulldoghelmit.png" width="150" height="99" /></span></p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p class="cent"> </p>
<div align="center">
<ul id="MenuBar1" class="MenuBarHorizontal">
<li> <a class="MenuBarItemSubmenu" href="#">Football Season 2008</a>
<ul>
<li><a href="http://page.bps101.net/web/t1350/Football2009/2008%20Defense%20Stats.pdf">Defense Stats</a></li>
<li><a href="http://page.bps101.net/web/t1350/Football2009/2008%20Offense%20Stats.pdf">Offense and Records</a></li>
<li><a href="http://page.bps101.net/web/t1350/BHS%20All%20Time%20Stats.pdf">AllTime Data</a></li>
<li><a href="http://page.bps101.net/web/t1350/Football2009/Western%20Sun%202009.pdf">Western Sun Final Standings</a></li>
</ul>
</li>
<li> <a href="#" class="MenuBarItemSubmenu">Football Season 2009</a>
<ul>
<li><a href="http://page.bps101.net/web/t1350/Football%202010/2009%20Banquet%20Record%20and%20Stats.pdf">Defense Stats</a></li>
<li><a href="http://page.bps101.net/web/t1350/Football%202010/2009%20Banquet%20Record%20and%20Stats.pdf">Record Book and Offense</a></li>
<li><a href="http://page.bps101.net/web/t1350/Football%202010/All-Time%20Data%202009.pdf">Alltime Data</a></li>
</ul>
</li>
<li> <a class="MenuBarItemSubmenu" href="#">Football Season 2010</a>
<ul>
<li><a href="http://page.bps101.net/web/t1350/Football%202011/2011%20Checklist.pdf">2010-2011 Offseason Checklist</a></li>
<li><a href="http://page.bps101.net/web/t1350/Football%202011/2010%20Defense%20Stats%20Final.pdf">Defense Stats</a></li>
<li><a href="http://page.bps101.net/web/t1350/Football%202011/2010%20Stats%20Packet.pdf">Record Book and Offense</a></li>
<li><a href="http://page.bps101.net/web/t1350/Football%202011/2010%20ALL%20TIME.pdf">Alltime Data</a></li>
</ul>
</li>
</ul>
</div>
<p align="center"> </p>
<p align="center"> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><img src="images/Batavia Youth football.png" alt="" width="869" height="200" /></p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','images/WebConfroll.png',1)"></a></p>
<div align="center">
<div align="center"></div>
<div align="center"><a href="http://www.athletics2000.com/upstate8/" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','images/WebConfroll.png',1)"><img src="images/WebConf.png" name="Image7" width="206" height="194" border="0" id="Image7" /></a><a href="http://www.bataviayouthfootball.org/" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','images/statefbsweatshirt.png',1)"><img src="images/statefbsweatshirt.jpg" name="Image6" width="375" height="199" border="0" id="Image6" /></a><a href="http://www.bataviayouthfootball.org/" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','images/youthfootballroll.png',1)"><img src="images/youth football.png" name="Image8" width="329" height="197" border="0" id="Image8" /></a></div>
</div>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','images/youthfootballroll.png',1)"></a></p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><img src="images/Logos.png" width="1167" height="199" /></p>
<script type="text/javascript">
var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
CSS CODE
@charset "UTF-8";
/* SpryMenuBarHorizontal.css - version 0.6 - Spry Pre-Release 1.6.1 */
/* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
LAYOUT INFORMATION: describes box model, positioning, z-order
/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
margin: auto 0;
padding: 0;
list-style-type: none;
font-size: 100%;
cursor: default;
width: 54em;
border-top: thick solid #00F;
border-left: thick solid #00F;
border-right: thick solid #00F;
border-bottom: thick solid #00F;
height: 2.2em;
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
z-index: 1000;
/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
position: relative;
cursor: pointer;
width: 18em;
float: left;
/* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarHorizontal ul
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: 18em;
position: absolute;
left: -1000em;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
left: auto;
/* Menu item containers are same fixed width as parent */
ul.MenuBarHorizontal ul li
width: 18em;
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
position: absolute;
margin: -5% 0 0 95%;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
left: auto;
top: 0;
DESIGN INFORMATION: describes color scheme, borders, fonts
/* Submenu containers have borders on all sides */
ul.MenuBarHorizontal ul
border: 1px solid #CCC;
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarHorizontal a
display: block;
cursor: pointer;
background-color: #000;
padding: 0.5em 0.75em;
color: #C96;
text-decoration: none;
text-align: center;
height: 1.2em;
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
background-color: #900;
color: #009;
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
background-color: #900;
color: #FFF;
text-decoration: underline;
SUBMENU INDICATION: styles if there is a submenu under a given menu item
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu
background-image: url(SpryMenuBarDown.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
color: #FF0;
font-family: "Lucida Console", Monaco, monospace;
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
background-image: url(SpryMenuBarRight.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
background-image: url(SpryMenuBarDownHover.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
background-image: url(SpryMenuBarRightHover.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
BROWSER HACKS: the hacks below should not be changed unless you are an expert
/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
ul.MenuBarHorizontal iframe
position: absolute;
z-index: 1010;
filter:alpha(opacity:0.1);
/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
@media screen, projection
ul.MenuBarHorizontal li.MenuBarItemIE
display: inline;
f\loat: left;
background: #FFF;
The website is http://wwww.bataviabulldogfootball.tkNote that running your page through the W3C Validator gives this list of errors: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.bataviabulldogfootball.tk%2F&charset=%2 8detect+automatically%29&doctype=Inline&group=0
I see that you have a very thin doctype at the top. I suggest you create a new page in Dreamweaver and copy the bit at the top of the page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Then put that code in place of these lines from your current page:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
I see that you have two opening <body> tags. Delete one; it is not needed. Add the preload images from the second into the first body tag and delete the second.
I see code below the closing </html> tag. Re position it before the closing </body> tag.
Because of these errors mentioned above, it was impossible to see the page. Fix and reply here when you have done so.
Also, it is not possible for me to divine what difficulty you are having. If you can please also express it in English (LOL), I'll be happy to suggest a correction for you!
Beth
p.s. Posting entire blocks of code is NEVER as helpful as giving us a link to the pages in action. I seldom read through code dumps here in the Forum.
Message was edited by: Zabeth69 -
Tty display problems with nvidia and uvesafb
I'm trying to get my console to display correctly at 1080p; trying to do so through GRUB was always an absolute nightmare.
The console displays fine with nouveau, but nouveau causes the infamous pink line bug, which is simply too irritating to ignore; nouveau is not an option.
In the past, my console has run at low res and incorrect scale with nvidia, but I've ignored the problem since I prefer to use a virtual terminal in X.
Now, if possible, I need to use the actual console for the purposes of module development.
I installed v86d and uvesafb and configured the console for 1920x1080 and 32 bit depth.
The console is displaying with the correct resolution now, but is surrounded by a black border, making the font distorted and extremely difficult to read.
How can I get my console to scale correctly to fullscreen? Any ideas at all. I found nothing in the forums or wiki, and I'm out.
I'm fairly certain there are no vga or video settings in GRUB that are interfering.Output of "pacman -Qi nvidia"
Name : nvidia
Version : 343.36-2
Description : NVIDIA drivers for linux
Architecture : x86_64
URL : http://www.nvidia.com/
Licenses : custom
Groups : None
Provides : None
Depends On : linux>=3.17 linux<3.18 nvidia-libgl nvidia-utils=343.36
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 5.30 MiB
Packager : Felix Yan <[email protected]>
Build Date : Thu 11 Dec 2014 08:32:19 AM CST
Install Date : Fri 12 Dec 2014 12:10:32 AM CST
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature
Output "cat /boot/grub/grub.cfg"
# DO NOT EDIT THIS FILE
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
set menu_color_normal=green/black
set menu_color_highlight=black/green
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 337acc84-0300-43b1-b426-79391d39e898
else
search --no-floppy --fs-uuid --set=root 337acc84-0300-43b1-b426-79391d39e898
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 337acc84-0300-43b1-b426-79391d39e898
else
search --no-floppy --fs-uuid --set=root 337acc84-0300-43b1-b426-79391d39e898
fi
insmod png
background_image -m stretch /boot/grub/archgrub.png
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-337acc84-0300-43b1-b426-79391d39e898' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 337acc84-0300-43b1-b426-79391d39e898
else
search --no-floppy --fs-uuid --set=root 337acc84-0300-43b1-b426-79391d39e898
fi
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=337acc84-0300-43b1-b426-79391d39e898 rw quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux.img
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-337acc84-0300-43b1-b426-79391d39e898' {
menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-337acc84-0300-43b1-b426-79391d39e898' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 337acc84-0300-43b1-b426-79391d39e898
else
search --no-floppy --fs-uuid --set=root 337acc84-0300-43b1-b426-79391d39e898
fi
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=337acc84-0300-43b1-b426-79391d39e898 rw quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux.img
menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-337acc84-0300-43b1-b426-79391d39e898' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 337acc84-0300-43b1-b426-79391d39e898
else
search --no-floppy --fs-uuid --set=root 337acc84-0300-43b1-b426-79391d39e898
fi
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=337acc84-0300-43b1-b426-79391d39e898 rw quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux-fallback.img
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
### BEGIN /etc/grub.d/60_memtest86+ ###
### END /etc/grub.d/60_memtest86+ ###
Output "cat /usr/lib/modprobe.d/uvesafb.conf"
Video mode is set as "1920x1080-32".
# This file sets the parameters for uvesafb module.
# The following format should be used:
# options uvesafb mode=<xres>x<yres>[-<bpp>][@<refresh>] scroll=<ywrap|ypan|redraw> ...
# For more details see:
# http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/fb/uvesafb.txt
options uvesafb mode_option=1920x1080-32 scroll=ywrap
This file is mirrored in /etc/modprobe.d/uvesafb.conf.
Running "diff /usr/lib/modprobe.d/uvesafb.conf /etc/modprobe.d/uvesafb.conf" returns no output.
Output of "cat /sys/class/graphics/fb0/virtual_size" is solely "1920,1080".
---edit---
Output of "cat /etc/default/grub" in case it's helpful.
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true
# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto
# Uncomment to allow the kernel use the same resolution used by grub
#GRUB_GFXPAYLOAD_LINUX=keep
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
GRUB_COLOR_NORMAL="green/black"
GRUB_COLOR_HIGHLIGHT="black/green"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
GRUB_BACKGROUND="/boot/grub/archgrub.png"
#GRUB_THEME="/path/to/gfxtheme"
# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"
#GRUB_SAVEDEFAULT="true"
Also, it might help to describe the behaviour more specifically / more in depth...
The rendered part of the console occupies the same space as the GRUB boot menu.
I installed and configured virtualbox a few weeks previously.
I ran "sudo depmod -a" as the wiki / forums indicated it could remedy problems with virtual machines failing to start.
It did fix the virtualbox problem; after reboot, suddenly lightdm *also* initally occupied the same window space as grub.
That was new behaviour. When I logged in to xmonad, the desktop displayed similarly to GRUB.
I hadn't tried fixing it; logging in with root followed by "ps -e | grep X" and "kill -9 <Xpid>" caused X as a whole to start behaving and scaling normally.
I haven't rebooted until attempting to rectify the issue with my console.
The oddity with scaling in lightdm and xmonad still shows up after reboot and is still reparable by killing X.
Killing X doesn't - obviously - have any effect on console scale.
---/edit---
d(-_-)
Last edited by seppukuzushi (2014-12-31 14:01:23) -
Player compatibility problem with dual layer media
I've created a dual layer DVD and there is a problem with compatibility from player to player.
It plays fine in one of my DVD players but will not load in the other.
The duplicators tested my master on 2 players and it loaded on both, but would lock up if a chapter was selected from the submenu.
It has 4 tracks of content. 3 menus, and a bunch of chapter markers. The original build had stories (replaced with standard chapter markers) but I removed them hoping it would solve the problem.
The imported video tracks were created with Compressor. MPEG-2 2 pass VBR max bit rate 7.5. AC3 audio tracks. 7.7 GB on disc.
I'm already way over my deadline and ahve no idea what to do next other than maybe recompress so the disc is not so close to being maxed out.Thats just how compatible that media is... +R DL (double layer) & -R DL are not that compatible. Recordable media is less compatible that replicated discs but double and dual layer media can be 50% compatible at best (depending on your target market...)
Good quality media, Verbatim +R DL for example burnt at slow speeds helps improve things,
-Jake -
Problem with SpryMenuBarHorizontal on IE any version
I have a problem with SpryMenuBarHorizontal, you do not see the SubMenu on IE.
It's ok on Firefox, Safari, Opera, but on any version of IE don't work.
I tried to fix the CSS, but nothing.
Thank you for your help
MargheritaThis is the URL http://www.datapress.it/hemodec/index.html
and this is the CSS. Thank you for the help
@charset "UTF-8";
/* SpryMenuBarHorizontal.css - version 0.6 - Spry Pre-Release 1.6.1 */
/* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
LAYOUT INFORMATION: describes box model, positioning, z-order
/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
list-style-type: none;
font-size: 100%;
cursor: default;
padding: 0;
margin: 0;
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
padding: 0px;
z-index: 1000;
/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
list-style-type: none;
font-size: 15px;
position: relative;
cursor: pointer;
font-family: Arial, Helvetica, sans-serif;
font-style: normal;
line-height: normal;
font-weight: bold;
text-decoration: none;
top: 5px;
padding: 0px;
float: left;
width: 15em;
/* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarHorizontal ul
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: 223px;
position: absolute;
left: -1000em;
border-bottom-width: thin;
border-bottom-style: dotted;
border-bottom-color: #FFF;
top: 25px;
height: 85px;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
left: 22px;
/* Menu item containers are same fixed width as parent */
ul.MenuBarHorizontal ul li
width: 8.2em;
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
margin: -5% 0 0 95%;
position: absolute;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
left: auto;
top: 0;
DESIGN INFORMATION: describes color scheme, borders, fonts
/* Submenu containers have borders on all sides */
ul.MenuBarHorizontal ul
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarHorizontal a
display: block;
cursor: pointer;
color: #7C4C25;
text-decoration: none;
padding-top: 0.5em;
padding-right: 0.75em;
padding-bottom: 0.5em;
padding-left: 0.75em;
width: 120px;
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
color: #F90;
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
color: #F90;
SUBMENU INDICATION: styles if there is a submenu under a given menu item
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu1
background-repeat: no-repeat;
background-position: 95% 50%;
top: 5px;
padding-left: 60px;
width: 200px;
text-align: left;
ul.MenuBarHorizontal a.MenuBarItemSubmenu2 {
background-repeat: no-repeat;
background-position: 95% 50%;
padding-left: 130px;
ul.MenuBarHorizontal a.MenuBarItemSubmenu3 {
background-repeat: no-repeat;
background-position: 95% 50%;
margin-left: 120px;
ul.MenuBarHorizontal a.MenuBarItemSubmenu4 {
background-repeat: no-repeat;
background-position: 95% 50%;
margin-left: 150px;
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
background-image: url(../SpryAssets/SpryMenuBarRight.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
background-color: #EDE8DF;
width: 213px;
border-bottom-width: medium;
border-bottom-style: double;
border-bottom-color: #FFF;
margin-right: 15px;
font-family: Arial, Helvetica, sans-serif;
font-weight: lighter;
font-size: 14px;
font-style: normal;
line-height: normal;
font-variant: normal;
text-transform: none;
text-decoration: none;
z-index: auto;
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu2 {
background-image: url(../SpryAssets/SpryMenuBarRight.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
background-color: #EDE8DF;
width: 204px;
border-bottom-width: medium;
border-bottom-style: double;
border-bottom-color: #FFF;
margin-left: 17px;
padding-left: 20px;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
line-height: normal;
font-weight: lighter;
font-variant: normal;
text-transform: none;
text-decoration: none;
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu3 {
background-image: url(../SpryAssets/SpryMenuBarRight.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
background-color: #EDE8DF;
width: 204px;
border-bottom-width: medium;
border-bottom-style: double;
border-bottom-color: #FFF;
margin-left: 34px;
padding-left: 20px;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
line-height: normal;
font-weight: lighter;
font-variant: normal;
text-transform: none;
text-decoration: none;
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu4 {
background-image: url(../SpryAssets/SpryMenuBarRight.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
background-color: #EDE8DF;
width: 213px;
border-bottom-width: medium;
border-bottom-style: double;
margin-left: 52px;
left: 80px;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
line-height: normal;
font-weight: lighter;
font-variant: normal;
text-transform: none;
text-decoration: none;
border-bottom-color: #FFF;
#ul.MenuBarHorizontal ul a.MenuBarItemSubmenu a:hover{
background-position:center right;
padding-right:40px;
color: #F90;
#ul.MenuBarHorizontal ul a.MenuBarItemSubmenu a.selezionato{
background-color:#D4CCB3;
background-position:bottom right;
padding-right:40px;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
background-image: url(../SpryAssets/SpryMenuBarDownHover.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
top: 145px;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
background-image: url(../../SpryAssets/SpryMenuBarRightHover.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
BROWSER HACKS: the hacks below should not be changed unless you are an expert
/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
ul.MenuBarHorizontal iframe
position: absolute;
z-index: 1010;
filter:alpha(opacity:0.1);
/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
@media screen, projection
ul.MenuBarHorizontal li.MenuBarItemIE
display: inline;
f\loat: left;
background: #FFF; -
Hi all...
I have a Menu called ActionEvents which has a JMenu called mouseEvents. What I want is to add a submenu to this (mouseEvents), I tried the following:
mouseEvents.add(new JMenuItem("New Item"));This compiles fine but doesnt show up on the application. However if I add another JMenu to ActionEvents e.g submenu as below, it adds the submenuItem to submenu.
JMenu submenu = new JMenu("submenu");
eventsMenu.add(submenu);
submenu.add(new JMenuItem("submenuItem"));Works fine for submenu but not mouseEvents.
Does any one have any ideas?
Thanks for any assiatance...Maybe I should take this to the bug report forum, but I was wondering if it might not be me. I'm pretty sure it isn't, but it is such a big problem I can't believe it would have not been caught and fixed before.
BTW, there is no problem with implementing submenus in AWT. -
Shared objects problem with translation
Hello
Here is my problem :
- my default portal language is French, and I login in French.
- I create a navpage in the "Shared objects" pagegroup. At Portal installation,
this pagegroup is in English, and there's an available translation in French.
- When i see my navPage being logged in French, the SmartLinks (Home, etc)
always display in English while i expected them to by in French.
- I don't have this problem in a "normal" pagegroup created in english and
translated into French.
regards
A.I have a second problem with shared objects :
So, i created that navpage and published it as a portlet to use it in pages but
when it doesn't appear in the portlets lists. In what Submenu of the porlets
navigator is it supposed to appear ? It is not in the "shared instances", and i
can't see any other "shared" directory. -
Dear friends:
First I have to request apologizes about my bad English.
I have a problem with an application deployed with JWS.
This application must start when the user logins into his domain account (in Windows). Thats easy to do: putting and shortcut to the desktop icon generated by JWS in the startup folder (or making a copy of the desktop icon).
All works well when I update the jar files in the server, the new version are downloaded fine. Except in one situation: if I update the application jnlp file.
Then the new jnlp file is downloaded, the desktop icon and the Startup->program files->my program icon is updated, but not the startup->program->startup icon.
Naturally the launch of the app at windows startup fails, and the only way to solve this problem is create another shortcut to the app icon in the startup folder.
But I have this app installed and running in more tan 50 clients... it is no very nice to do this job every time the jnlp has to change.
Thanks in advance for the help.I'm using mustang (jre 1.6beta), because I'm using
the system tray icon feature.
But I had the same problem in the past with
jre1.5_06
It is interesting what you told me about putting the
icon in the startup folder using jnlp. How can this
be done?
by adding the <shortcut> element as follows:
<shortcut>
<menu submenu="Startup"/>
</shortcut>
/Andy
e -
Hi,
I've had a long running problem with my keycode in Xcelsius 2008. I've tried various things suggested by my supplier, but nothing seems to work. I thought I'd try here to see if anyone else can help. The details are:
We are running Windows XP Pro SP3. I had Crystal Reports XI installed. We purchased Crystal Reports 2008 Visual Advantage, and were issued with a single keycode. When we installed Crystal Reports 2008 using the keycode, everything was fine. When we installed Xcelsius 2008 we used the same keycode, but the program seemed to bee in a trial version state (i.e. all the save options / most of the export options are greyed out).
We have changed the permissions on the registry to ensure that all users have full control in HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0.
We have removed the keycode from HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Xcelsius\Keycodes and restarted the application and entered the keycode when prompted.
We have removed the keycode from HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Xcelsius\Keycodes and entered the keycode directly into the registry.
None of the above actions have helped (we have tried them all repeatedly in various orders). I've had this software for about a year now, but am not able to use it. I am getting more than a little frustrated.
Can anyone offer any advice or help?
Many thanks
Steve Birch
Edited by: Steve Birch on Jun 24, 2010 12:57 PMHi,
Thank you for the very quick reply.
When I look at the export tool bar I only have "Send to Adobe Acrobat PDF" enabled ("Send to PowerPoint", "Send to Microsoft Word", "Attach the SWF in Outlook" and "Export to Business Objects Platform" are all disabled).
When I look at the standard toolbar "Save" and "Print the SWL file" are greyed out.
When I look at the "File" drop down menu, the following items are greyed out:
Save
Save As...
Save To Enterprise
Page Setup...
Print...
Print Preview
When I look at the "Export" submenu, the following items are greyed out:
HTML...
Business Objects Platform...
PowerPoint Slide...
Outlook
Word...
When I look at the "Snapshot" submeu, all items are greyed out.
Because I have never used the software before, I'm not sure what should be enabled / disabled when looking at the menus, but I should be able to save shouldn't I?
I believe I have Flash Player version 9,0,124,0 installed. Will this be causing a problem?
Also, just to clarify. We bought 2 copies of the software for 2 different computers. They both have the same problem.
Thanks again for your quick reply.
Regards
Steve Birch -
I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
Thank you in advance,
LeftyThis was one solution from the socket programming forum, have you tried this??
public Thread MyThread extends Thread{
boolean active = true;
public void run(){
ss.setSoTimeout(90);
while (active){
try{
serverSocket = ss.accept();
catch (SocketTimeoutException ste){
// do nothing
// interrupt thread
public void deactivate(){
active = false;
// you gotta sleep for a time longer than the
// accept() timeout to make sure that timeout is finished.
try{
sleep(91);
}catch (InterruptedException ie){
interrupt();
} -
Problem with Threads and a static variable
I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
Code functionality:
A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
The problem as far I understand is:
Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
Thanks,
B.D.
Code:
private static volatile boolean bChanged = false;
private static Thread objMainProcess;
protected static void Init(){
objMainProcess = new Thread() {
public void run() {
while( objMainProcess == Thread.currentThread() ) {
GetState();
objMainProcess.setDaemon( true );
objMainProcess.start();
public static void initStatusTimer(){
if(objTimer == null)
objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
public void actionPerformed( java.awt.event.ActionEvent evt){
SetState();
private static void SetState(){
if( objMainProcess == null ) return;
synchronized( objMainProcess ) {
bChanged = true;
try{
objMainProcess.notify();
}catch( IllegalMonitorStateException e ) {}
private static boolean GetState() {
if( objMainProcess == null ) return false;
synchronized( objMainProcess ) {
if( bChanged) {
SendMessage();
bChanged = false;
return true;
try {
objMainProcess.wait();
}catch( InterruptedException e ) {}
return false;
}Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
Again as you said, There is a reason I can't call sendMessage() inside setState().
The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
Thanks,
B.D. -
Problem with threads running javaw
Hi,
Having a problem with multi thread programming using client server sockets. The program works find when starting the the application in a console using java muti.java , but when using javaw multi.java the program doesnt die and have to kill it in the task manager. The program doesnt display any of my gui error messages either when the server disconnect the client. all works find in a console. any advice on this as I havent been able to understand why this is happening? any comment would be appreciated.
troy.troy,
Try and post a minimum code sample of your app which
does not work.
When using javaw, make sure you redirect the standard
error and standard output streams to file.
Graeme.Hi Graeme,
I dont understand what you mean by redirection to file? some of my code below.
The code works fine under a console, code is supposed to exit when the client (the other server )disconnects. the problem is that but the clientworker side of the code still works. which under console it doesnt.
public class Server{
ServerSocket aServerSocket;
Socket dianosticsSocket;
Socket nPortExpress;
ClientListener aClientListener;
LinkedList queue = new LinkedList();
int port = 0;
int clientPort = 0;
String clientName = null;
boolean serverAlive = true;
* Server constructor generates a server
* Socket and then starts a client threads.
* @param aPort socket port of local machine.
public Server(int aPort, String aClientName, int aClientPort){
port = aPort;
clientName = aClientName;
clientPort = aClientPort;
try{
// create a new thread
aServerSocket = new ServerSocket(port) ;
// connect to the nPortExpress
aClientListener = new ClientListener(InetAddress.getByName(clientName), clientPort, queue,this);
// aClientListener.setDaemon(true);
aClientListener.start();
// start a dianostic port
DiagnosticsServer aDiagnosticsServer = new DiagnosticsServer(port,queue,aClientListener);
// System.out.println("Server is running on port " + port + "...");
// System.out.println("Connect to nPort");
catch(Exception e)
// System.out.println("ERROR: Server port " + port + " not available");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Server port " + port + " not available", JOptionPane.ERROR_MESSAGE);
serverAlive = false;
System.exit(1);
while(serverAlive&&aClientListener.hostSocket.isConnected()){
try{
// connect the client
Socket aClient = aServerSocket.accept();
//System.out.println("open client connection");
//System.out.println("client local: "+ aClient.getLocalAddress().toString());
// System.out.println("client localport: "+ aClient.getLocalPort());
// System.out.println("client : "+ aClient.getInetAddress().toString());
// System.out.println("client port: "+ aClient.getLocalPort());
// make a new client thread
ClientWorker clientThread = new ClientWorker(aClient, queue, aClientListener, false);
// start thread
clientThread.start();
catch(Exception e)
//System.out.println("ERROR: Client connection failure");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client connection failure", JOptionPane.ERROR_MESSAGE);
}// end while
} // end constructor Server
void serverExit(){
JOptionPane.showMessageDialog(null, "Server ","ERROR: nPort Failure", JOptionPane.ERROR_MESSAGE);
System.exit(1);
}// end class Server
*** connect to another server
public class ClientListener extends Thread{
InetAddress hostName;
int hostPort;
Socket hostSocket;
BufferedReader in;
PrintWriter out;
boolean loggedIn;
LinkedList queue; // reference to Server queue
Server serverRef; // reference to main server
* ClientListener connects to the host server.
* @param aHostName is the name of the host eg server name or IP address.
* @param aHostPort is a port number of the host.
* @param aLoginName is the users login name.
public ClientListener(InetAddress aHostName, int aHostPort,LinkedList aQueue,Server aServer) // reference to Server queue)
hostName = aHostName;
hostPort = aHostPort;
queue = aQueue;
serverRef = aServer;
// connect to the server
try{
hostSocket = new Socket(hostName, hostPort);
catch(IOException e){
//System.out.println("ERROR: Connection Host Failed");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort Failed", JOptionPane.ERROR_MESSAGE);
System.exit(0);
} // end constructor ClientListener
** multi client connection server
ClientWorker(Socket aSocket,LinkedList aQueue, ClientListener aClientListener, boolean diagnostics){
queue = aQueue;
addToQueue(this);
client = aSocket;
clientRef = aClientListener;
aDiagnostic = diagnostics;
} // end constructor ClientWorker
* run method is the main loop of the server program
* in change of handle new client connection as well
* as handle all messages and errors.
public void run(){
boolean alive = true;
String aSubString = "";
in = null;
out = null;
loginName = "";
loggedIn = false;
while (alive && client.isConnected()&& clientRef.hostSocket.isConnected()){
try{
in = new BufferedReader(new InputStreamReader(client.getInputStream()));
out = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
if(aDiagnostic){
out.println("WELCOME to diagnostics");
broadCastDia("Connect : diagnostics "+client.getInetAddress().toString());
out.flush();
else {
out.println("WELCOME to Troy's Server");
broadCastDia("Connect : client "+client.getInetAddress().toString());
out.flush();
String line;
while(((line = in.readLine())!= null)){
StringTokenizer aStringToken = new StringTokenizer(line, " ");
if(!aDiagnostic){
broadCastDia(line);
clientRef.sendMessage(line); // send mesage out to netExpress
out.println(line);
out.flush();
else{
if(line.equals("GETIPS"))
getIPs();
else{
clientRef.sendMessage(line); // send mesage out to netExpress
out.println(line);
out.flush();
} // end while
catch(Exception e){
// System.out.println("ERROR:Client Connection reset");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR:Client Connection reset", JOptionPane.ERROR_MESSAGE);
try{
if(aDiagnostic){
broadCastDia("Disconnect : diagnostics "+client.getInetAddress().toString());
out.flush();
else {
broadCastDia("Disconnect : client "+client.getInetAddress().toString());
out.flush();
// close the buffers and connection;
in.close();
out.close();
client.close();
// System.out.println("out");
// remove from list
removeThreadQueue(this);
alive = false;
catch(Exception e){
// System.out.println("ERROR: Client Connection reset failure");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client Connection reset failure", JOptionPane.ERROR_MESSAGE);
}// end while
} // end method run
* method run - Generates io stream for communicating with the server and
* starts the client gui. Run also parses the input commands from the server.
public void run(){
boolean alive = true;
try{
// begin to life the gui
// aGuiClient = new ClientGui(hostName.getHostName(), hostPort, loginName, this);
// aGuiClient.show();
in = new BufferedReader(new InputStreamReader(hostSocket.getInputStream()));
out = new PrintWriter(new OutputStreamWriter(hostSocket.getOutputStream()));
while (alive && hostSocket.isConnected()){
String line;
while(((line = in.readLine())!= null)){
System.out.println(line);
broadCast(line);
} // end while
} // end while
catch(Exception e){
// System.out.println("ERRORa Connection to host reset");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort reset", JOptionPane.ERROR_MESSAGE);
try{
hostSocket.close();
}catch(Exception a){
JOptionPane.showMessageDialog(null, (a.toString()),"ERROR: Exception", JOptionPane.ERROR_MESSAGE);
alive = false;
System.exit(1);
} // end method run
Maybe you are looking for
-
Hi all! I was updating the software on i pad to ios6, update was interrupted(apple update server is unavailable...). iTunes Diagnostics shows that "secure link to I tunes store failed". I use Windows 7 Home Premium 64 bit. Can anybody help please? Th
-
Insert trigger with if condition
Hi. I am new sql programming and I am trying to write a insert trigger. I have created an insert-trigger that inserts into another table(p_person) whenever the trigger table (p_personmds) gets insterted: CREATE OR REPLACE TRIGGER INSERT_P_PERSON_TG A
-
How to disable iTunes suggestions in Safari?
I find most suggestions in Safari useful (like Wikipedia) but since I never buy music on iTunes, how can I turn off music suggestions? iPhone 6 - iOS 8.1.1
-
Did 10.6.5 alter the permissions of the top level of the startup volume?
Since applying the 10.6.5 update it seems that non-admin users have read/write access to the top level directory of the startup volume. That means that non-admin users can create items there. I am wondeing if this is a normal change for 10.6.5 or if
-
Por que no puedo llamar a numeros cortos desde siri?
Hola. Ayer adquirí un iphone 5 y comence a probar Siri en español. Va perfecto, pero no puedo llamar a numeros cortos corporativos ni a través de contactos ni a través de indicarle la numeración. Si pulso el contacto o marco el numero si que llama. ¿