Saving an off screen Swing JPanel to a BufferedImage

First, thanks for reading this. I have read through almost the whole forum and tried countless deviations of examples given here, but to no success.
The situation is that from an Java 1.3 Applet, I am creating the ability for a user to create a simple graphic using standard Swing JTextArea components. This gives him/her the ability to place text arbitrarily on an JPanel. This works fine. The problem comes when the user wants to preview the image with the parametes replaced in the JTextAreas.
We are generating GIF files after the user puts in the data. The problem occurs when we create an off screen JPanel with new JTextAreas with the parameters replaced with the test data filled in. We seem unable to create a BufferedImage from the un-shown JPanel.
I have tried putting the JPanel in a JFrame and showing it before I call paint/print, etc. The only thing that seems to happen is that the JPanel background color is rendered to the GIF file, but not the JTextAreas on the JPanel. I have sucessfully written directly to the Graphics of the JPanel using drawString and generated a GIF, but that does not accomplish our goal.
Any help would be appreciated. A test routine is included to give you the code. TIA.
Kurt
void test() {
int height = 400;
int width = 400;
JFrame jf = new JFrame();
jf.setBounds(0, 0, width, height);
JPanel p = new JPanel();
p.setBackground(Color.blue);
p.setSize(width,height);
JTextArea ta = new JTextArea();
ta.setBackground(Color.black);
ta.setForeground(Color.red);
ta.setText("This is the text to set");
ta.setColumns(10);
ta.setRows(3);
ta.setEditable(true);
ta.setEnabled(true);
ta.setVisible(true);
p.add(ta);
p.validate();
jf.getContentPane().add(p);
jf.validate();
saveToFile(p);
// This was taken and slightly modified for the AnimagedGifEncoder
void saveToFile(JComponent source) {
int w = source.getWidth();
int h = source.getHeight();
int type = BufferedImage.TYPE_INT_RGB;
BufferedImage image = new BufferedImage(w, h, type);
Graphics2D g2 = image.createGraphics();
source.paint(g2);
g2.dispose();
AnimatedGifEncoder gif = new AnimatedGifEncoder();
gif.start("D:/tmp/gifs/mygif.gif");
gif.setDelay(1000);
gif.addFrame(image);
gif.finish();

Your approach "putting the JPanel in a JFrame and showing it before I call paint/print" was ok, but it must be done in another thread, this sample is doing a similar job.
You will see that when the print dialog is shown, the frame is fully visible with the button,
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.print.*;
public class PrintF extends JFrame
     JPanel  pan = new JPanel();
     JButton pri = new JButton("Print");
     JButton b1 = new JButton("The Click");
public PrintF()
     super("This is a full frame print test");
     setBounds(1,1,500,350);     
     addWindowListener(new WindowAdapter()
    {     public void windowClosing(WindowEvent ev)
               dispose();     
               System.exit(0);
     getContentPane().add("Center",pan);
     pan.setBackground(Color.white);
     pan.add(new JLabel("Label 1"));
     pan.add(pri);
     pri.addActionListener(new ActionListener()
     {     public void actionPerformed( ActionEvent e )
               TheT t = new TheT(b1);
//               printIt(); 
     setVisible(true);
public class TheT extends Thread  implements Printable
     JFrame  frame = new JFrame("The printed frame");  
public TheT(JButton b)
     frame.setBounds(50,50,400,350);     
     frame.getContentPane().setLayout(null);     
     frame.getContentPane().add(b);
     b.setBounds(20,80,150,30);     
     start();
public void run()
     frame.setVisible(true);
     printIt(); 
     frame.dispose();
private void printIt()
     PrinterJob pj = PrinterJob.getPrinterJob();  
     PageFormat pf = pj.defaultPage();
     pf.setOrientation(pf.LANDSCAPE);
     pj.setPrintable(this,pf);
     if (pj.printDialog())
          try
               pj.print();
          catch (Exception e){}    
public int print(Graphics g, PageFormat pf, int pi)
                                            throws PrinterException
     if (pi > 0)
          setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
          return Printable.NO_SUCH_PAGE;
     setCursor(new Cursor(Cursor.WAIT_CURSOR));
     g.translate((int)pf.getImageableX()+2,(int)pf.getImageableY()+2);
     try
          Robot     r     = new Robot();
          Rectangle rect  = frame.getBounds();
          Image     image = r.createScreenCapture(rect);
          g.drawImage(image,2,2,null);
     catch(AWTException awe)
          System.out.println("robot excepton occurred");
     return(Printable.PAGE_EXISTS);
public static void main (String[] args)
     new PrintF();  
}       Noah

Similar Messages

  • Get an off-screen thumbnail from a webpage

    Hello everyone! This is my first post on this forums.
    I'm developing an application to get a thumbnail from a webpage, and save that thumbnail to a file. It has to be a "non-visual", off-screen appllication, because it will run on a machine with no screen. It has to render all, or almost all webpages.
    The thumbnails created by this app will be used on another app which lists links from an user, like it's shown in http://del.icio.us ; what I want is to generate these thumbnails.
    I've previously searched for a solution in this post: http://forum.java.sun.com/thread.jspa?forumID=20&threadID=709683 , it is not exactly what I want. I need a real image to be generated, not only a page preview.
    I've tried to use several java-based projects founded on Internet, but I didn't success because sometimes they render ok the page (using a window), but don't paint ok to file; sometimes they paint ok to file, but doesn't render ok the page (using a window) due to poor support of current HTML and CSS standards, as they are based on JEditorPane or the project is abandoned..
    The best approach I have made is with Flying Saucer (https://xhtmlrenderer.dev.java.net/), it does exactly what I need, it has even a method to do this, but it is very rigid about standards and doesn't render "real world html". Related to this I've tried to get code from page, clean it with tagsoup and then pass the xhtml code parsed to Flying Saucer's renderer, but it still has problems rendering the majority of webpages.
    Any ideas? Anything that can put me in the right direction is welcome.
    Thanks!

    Hello 4fingers, and thank you for your answer and suggestions.
    About the first one, it's a way, I'll annotate it but the goal it's to don't depend on others, this is going to execute on an automatic process, imagine if the service fails for some reason, the service is not available or it has ended...
    About the second one, I knew existence of JRex through my search. I looked for an example and found this web: http://blogs.pathf.com/agileajax/2007/01/how_to_really_d.html , but I didn't even tried it when I read this tips that also are at that web (mainly, #1):
    There are a couple of issues that complicate matters, however:
    1. JRex just won't run in headless mode. You have to have a display. On Linux you could use VNC.
    2. With the complication of classloaders, etc., JRex won't run easily or cleanly in Tomcat, Jetty, etc. Therefore I decided to use a simple embedded web server. This of course has its downsides, as a good servlet container provides you with a number of advantages.
    3. JRex is not a pure HTML renderer -- it is an application, that pops up dialogs, responds to user events, etc. There may be a way to just use it as renderer, but that documentation thing gets in the way again. As it is now, there is no way to tell whether the rendering was successful or whether the JRex component is stuck with a modal dialog telling the nonexistent user that the server was not responding.
    4. JRex is not a real Swing/AWT component. You can't use a Graphics object to paint it to an offscreen image; all you will get is a blank page. We need to capture the part of the screen that corresponds to the browser window. That means that the browser window needs to be on top and of the size you want to image. It also means we need one display per preview server if we want to scale. (On Linux you could scale with multiple servers and multiple X displays such as VNC.)
    5. We can only handle one request at a time per preview server as we only have one screen.
    After that, the example goes into creating a JFrame, showing it on screen...
    I found on my research the #1 with, for example, JDIC Browser, which is easy to deploy but when you render the panel to a buffered image you get a beautiful black screen :D.
    Today I visited Cobra's renderer webpage, http://html.xamjwg.org/cobra.jsp, to see if they had released an update (0.97, also with a browser, "lobobrowser"), and they did, I tried it but it's the same result I got two weeks ago, it paints ok to image, but the page render it's still too bad. They are improving this as they say, so I'll keep an eye on this.
    At least this project. Cobra, and Flying Saucer, aren't dead. If I find any solution I'll post here. And as always, any ideas are welcome.

  • Javax.swing.JPanel Help

    my application is sort of a game, i planned on having a JPanel subclass called EventPanel have an instance variable _curPanel.
    curPanel is of type JPanel. In the constructor  I can set curPanel to Other JPanel subclasses. I have another subclass of JPanel called MainScreen, which has the main screen for the game.
    I can set curPanel = new MainScreen(); in the constructor for eventPanel. And it works.
    But if I try to change _curPanel after i've made it, it wont show up. I have a method which signature 
    void setPanel(javax.swing.JPanel panel)
        _curPanel = panel;
        repaint();
    }to change the EventPanel, but nothing changes.
    In the MainScreen class there is a method call
    _eventPanel.setPanel(new NewPlayerPanel());and nothing changes in the code. I have a JTextArea logging info, and in the constructor for NewPlayerPanel at the end it prints a message in my JTextArea. The Panel is being created but not showing up.
    I have also tried creating the panel in an instance variable, setting it to setVisbile(true) and trying again and it doesnt work.

    In other words...
    char c=evt.getKeyChar();c is some character based on this event.
    if(c=='1'){Ok, let's say it is '1'...
    ...> char c2=evt.getKeyChar();Then c2 is also '1'.evt.getKeyChar() isn't going to magically change to be something different than it returned when you called it a few lines up before, so...>if(c2=='a')...this can never be true, given the above.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Off-screen title bar and menu

    I have a dual monitor setup, where the monitors have different resolution. I usually open documents on the larger screen, but if I open a second document it opens on the smaller screen with title bar and main menu off-screen. Is it any way I can anchor new windows to the top of the screen instead of the bottom?

    parish_chap wrote:
    V.K. wrote:
    parish_chap wrote:
    Unfortunately, as with Expose, the Prefs window disappears when I activate Spaces.
    I don't quite understand what you mean. do you mean that the system preferences window moves off screen when you enable spaces? when you enter spaces view (F8 is the default shortcut) you should see all windows in all spaces on all monitors. is this not working?
    It isn't displayed, i.e. it disappears. Remember this is a MS app and appears to follow the semantics of modal dialogues in Windows, i.e. they aren't "real" windows. They are a PITA in Windows as it's possible to hide them with another window and they are a pain to find - they don't appear in window lists and you can't Alt-TAB to them.
    oh, yes, I forgot about that. I know that MS office Spaces integration was supposed to be fixed in Snow Leopard but I guess that didn't happen with MSN messenger. that's probably also the reason those apple scripts you tried didn't work.
    Looking at this from a different angle, where are window positions likely to be saved as the position is retained across reboots. Is it the OS that handles this, or the app itself?
    the window positions of an application are stored in the preference file of that application in /users/username/library/preferences. if you quit an application, delete its preference file and relaunch it then it should display on the default screen with default values. however, some apps (like Mail) keep important data in their preference files and deleting them will wipe that data.
    Thanks. As you said about Mail, MSN Messenger stores all its data in their, e.g. account details, and the plist file is binary, but a quick Google revealed plutil so I converted it to XML, edited it in vi, and converted back to binary +et voilà+ it worked!!
    The window position was 0, -56 so I just changed it to 0, 56
    that will of course, do it.
    Thanks for your help!
    you are welcome.

  • Access off screen data

    Does anyone know if it is possible to do the following in Java (It is step 2 that I need help with):
    1) Load any third party application e.g Firefox
    This will display part of a web page and the rest will only be made visible by using the scrollbar.
    2) I want to access the text/images in the whole of the web page without using the scroll bar. e.g access off screen data and save it to something like a BufferedImage.(I guess it is similar to a screenshot but of data that is not currently visible on the screen).
    I need this to be generic enough to work for any application that uses scroll bars.
    Thanks

    1. Use Runtime.getRuntime().exec( <command> ) to run another program.
    2. You can use ImageIO.read( <url> ) to read images and return a BufferedImage from the internet.
    You can give this program I made a test drive as it shows how to run a separate process and load an image from the internet:
    /* DynamicClasses.java
    * @author scphan
    * created: 12, May 2009
    * tested successfully with jdk1.6.0_11
    import java.lang.ref.*;
    import java.util.*;
    import javax.tools.*;
    import java.io.*;
    public class DynamicClasses
         public static void main( String args[] )
              DynamicClasses obj = new DynamicClasses();
              obj.compileAndRun( new File( "CompileTest.java" ) );
         public void compileAndRun( final File file )
              JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
              StandardJavaFileManager filemanager = compiler.getStandardFileManager( null, null, null );
              System.out.println( "Default Compiler: " + compiler.getClass().getName() + "  toString(): " + compiler );
              try
                   deleteClassFile( file );
                   try
                        Thread.sleep( 5000 );
                   catch ( InterruptedException e )
                        e.printStackTrace();
                   Iterable compilationUnits = filemanager.getJavaFileObjects( file );
                   compiler.getTask( null, filemanager, null, null, null, compilationUnits ).call();
                   filemanager.close();
                   run( file.getName().replaceAll(".java","") );
              catch ( IOException e )
                   e.printStackTrace();
         public void run( final String filenameNoExt )
              throws IOException
              Process proc = Runtime.getRuntime().exec( String.format( "java %s", filenameNoExt ) );
         private void deleteClassFile( File file )
              String fNameNoExt = file.getName().replaceAll( ".java", "" );
              File xFile = new File( fNameNoExt+".class" );
                   if ( xFile.exists() )
                        xFile.delete();
    /* CompileTest.java
    * @author scphan
    * created: 12, May 2009
    * tested successfully with jdk1.6.0_11
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    import java.net.URL;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    public class CompileTest
         private static final String IMAGE_URL = "http://konohaleaf.info/images/stories/cherry_tree.png";
         public static void main( String args[] )
              final JOptionPane pane = new JOptionPane();
              pane.showMessageDialog( null, "Greetings, compiling test successful!", "Compile Test Successful", JOptionPane.INFORMATION_MESSAGE );
              final JFrame f = new JFrame( "Compile Test Successful" );
              f.setDefaultCloseOperation( f.EXIT_ON_CLOSE );
              final JLabel label = new JLabel();
              final BufferedImage image = grabImage( CompileTest.IMAGE_URL );
              if ( image != null )
                   label.setIcon( new ImageIcon(image) );
              else
                   label.setText( "Image could not load, displaying alternative text instead..." );
              f.getContentPane().add( label );
              f.pack();
              f.setVisible( true );
         private static BufferedImage grabImage( String url )
              BufferedImage image = null;
              try
                   image = ImageIO.read( new URL( url ) );
              catch ( IOException e )
                   e.printStackTrace();
                   return null;
              return image;
    }[http://konohaleaf.info/index.php?option=com_content&view=article&id=71:programmatically-compile-and-execute-in-java&catid=50:misc-example-programs&Itemid=64]
    Just parse through the html code for any <img src... ".jpg", ".png", etc. and store the paths which will then be used to read the images with javax.imageio.ImageIO.
    Edited by: scphan on May 13, 2009 1:09 PM

  • Dialog boxes appear off screen

    Hi!
    I'm using Illustrator CC on a MacBook Pro. I use an external monitor as a second screen and usually move the application frame to the external monitor and work there. I started having the follwing problem: when I try to save or open a file, the dialogue box appears slightly off screen, so that I can't for instance type in a new file name, because I can't get to that part of the dialogue box.
    I have tried switching between different screen modes, but it doesn't help. Also I can't manually move the dialog box - which also seems strange.
    My external monitor is a NEC MultiSync EA273WM.
    Any idea what could be the problem or how to solve it? It's slowly driving me mad...
    Thanks in advance!

    Harlev schrieb:
    Any idea what could be the problem or how to solve it? It's slowly driving me mad...
    At the moment it looks like the problem is called 10.10.2
    You can read through the posts of last week on this forum, but I'm afraid you won't find a solution.

  • Spry Menu Bar jumps off screen-right in CS6

    Frustrating little glitch I'm experiencing.  When in a NON-LIVE mode in CS6, I have a Spry Menu Bar that I've placed, customized and is functioning properly.  It is precisely in the right location in BOTH live mode and in a browser preview, however, when I am editing the site the menu bar jumps off screen right to where I have to scroll right to locate it.  The only thing that pops it back in to place is by tweaking a setting like "Float" from right to left then back to right.  But once I begin to edit the site again it will jump off the screen.  This isn't a massive deal since it remains in place in live and preview modes, it's just annoying for layout purposes while I'm editing.  It sort of screws up the aesthetic of the layout.  Has anyone found the same problem?  Below is my layout.css and my Spry Menu css.
    @charset "utf-8";
    /* Simple fluid media
       Note: Fluid media requires that you remove the media's height and width attributes from the HTML
       http://www.alistapart.com/articles/fluid-images/
    img, object, embed, video {
        max-width: 100%;
    /* IE 6 does not support max-width so default to width 100% */
    .ie6 img {
        width:100%;
        Dreamweaver Fluid Grid Properties
        dw-num-cols-mobile:        6;
        dw-num-cols-tablet:        8;
        dw-num-cols-desktop:    12;
        dw-gutter-percentage:    15;
        Inspiration from "Responsive Web Design" by Ethan Marcotte
        http://www.alistapart.com/articles/responsive-web-design
        and Golden Grid System by Joni Korpi
        http://goldengridsystem.com/
    /* Mobile Layout: 480px and below. */
    .gridContainer {
        margin-left: auto;
        margin-right: auto;
        width: 95.8695%;
        padding-left: 1.0652%;
        padding-right: 1.0652%;
    #LayoutDiv1 {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #header {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #maincontent {
        clear: none;
        float: left;
        margin-left: 2.6785%;
        width: 100%;
        display: block;
    #navigation {
        clear: none;
        float: left;
        margin-left: auto;
        width: 100%;
        display: block;
        margin-top: 20px;
        margin-bottom: 20px;
        background-color: #300;
        height: 16px;
        top: 5px;
    #footer {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
        color: #FFF;
        background-attachment: fixed;
        background-image: url(../bkgdContent.png);
        background-repeat: repeat;
        margin-top: 20px;
    /* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */
    @media only screen and (min-width: 481px) {
    .gridContainer {
        width: 91.4836%;
        padding-left: 0.7581%;
        padding-right: 0.7581%;
    #LayoutDiv1 {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #header {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
        text-align: center;
    #maincontent {
        clear: none;
        float: left;
        margin-left: 1.6574%;
        width: 100%;
        display: block;
    #navigation {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
        height: 16px;
    #whf-content {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #donatecontent {
        clear: none;
        float: left;
        margin-left: 1.6574%;
        width: 100%;
        display: block;
    #theride-content {
        clear: both;
        float: left;
        margin-left: 0;
        width: 49.1712%;
        display: block;
    #donate-content {
        clear: none;
        float: left;
        margin-left: 1.6574%;
        width: 49.1712%;
        display: block;
    #footer {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    /* Desktop Layout: 769px to a max of 1232px.  Inherits styles from: Mobile Layout and Tablet Layout. */
    @media only screen and (min-width: 769px) {
    .gridContainer {
        width: 89.0217%;
        max-width: 1232px;
        padding-left: 0.4891%;
        padding-right: 0.4891%;
        margin: auto;
    #LayoutDiv1 {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #header {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
        color: #FFF;
    #maincontent {
        clear: both;
        float: left;
        margin-left: 0;
        width: 32.6007%;
        display: block;
    #navigation {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #whf-content {
        clear: both;
        float: left;
        margin-left: 0;
        width: 32.6007%;
        display: block;
    #donatecontent {
        clear: none;
        float: left;
        margin-left: 1.0989%;
        width: 100%;
        display: block;
    #donate-content {
        clear: none;
        float: left;
        margin-left: 1.0989%;
        width: 32.6007%;
        display: block;
    #footer {
        clear: both;
        float: left;
        margin-left: 0;
        width: 100%;
        display: block;
    #theride-content {
        clear: none;
        float: left;
        margin-left: 1.0989%;
        width: 32.6007%;
        display: block;
    #whf-content {
        font-family: Georgia, "Times New Roman", Times, serif;
    SPRY CSS
    @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: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        cursor: default;
        width: auto;
        float: right;
    /* 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;
        text-align: left;
        cursor: pointer;
        width: 4.3em;
        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: 4.3em;
        position: relative;
        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
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
    ul.MenuBarHorizontal ul ul
        position: relative;
        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
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarHorizontal a
        display: block;
        cursor: pointer;
        background-color: #300;
        color: #FFF;
        text-decoration: none;
        font-size: 12px;
        font-family: Georgia, "Times New Roman", Times, serif;
        text-align: center;
        height: 16px;
        padding: 0px;
    /* 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: #003;
        color: #FFF;
    /* 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: #003;
        color: #FFF;
    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%;
    /* 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;

    Design view is not reliable.  Learn to work in Code View or Split View with Live View to check your layout.
    Spry menus are not responsive so they will not work well in a Fluid Grid Layout.  Find a better menu system.
    Project Seven Responsive Tabs
    http://www.projectseven.com/products/tools/tpm2/tutorials/responsive/index.htm
    10 Responsive Menus
    http://speckyboy.com/2012/08/29/10-responsive-navigation-solutions-and-tutorials/
    In the meantime,
    It's often easier to work with an unstyled HTML page. 
    To disable CSS, go to  View > Style Rendering > untick Display Styles. 
    Or, use a Design-Time Style Sheet.
    http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7e17a.h tml
    Nancy O.

  • How can I fix a Window that disappears Off Screen

    Hi,
    I'm running a new installation of MAX/msp and the output window does not appear on my monitor. When I use exspose the window comes in to view but when I click on it it disappears off screen to the left, therefore I can't grab it with my mouse.
    I think the problem stems from when I was using dual monitors, one of which burned out so I am now only using one.
    So far I've deleted all the MAX/msp preferences that I can find.
    I've looked in System Preferences - Displays - This shows that my mac only expects to see my single monitor.
    I remember in OS9 there was a key command to allow you to move windows without the use of a mouse - If there's one for OSx it would probably solve my problem but I can't find it.
    I'm using a G4 dual 867 OSX 10.4.7 with a SyncMaster920n monitor
    Any help appreciated
    James
    G4 dual   Mac OS X (10.4.7)  

    ok problem solved from within MAX
    Menu: window -> alt + click window of your choice
    James

  • How do I use serial port read and show text, but not have it scroll off screen?

    I am new-ish/returning amateur user of Labview and I am trying to edit the example VI "Advanced serial write and read VI" that is part of dev suite 2012.  I need to use the string box to show ALL text received from serial port, always appending and only rolls off screen when more real data arrives at serial port. 
    What is actually happening is as more bytes (or no bytes AT ALL!) arrive during read time, current text rolls off the string box.  Even when 0 bytes are received, screen is blanked out.  I am not very familiar with functions locations and even worse at understanding obscure references to functions, so please keep replies very basic so I can follow.
    Just to be clear, I need the string window to behave like hyperterm does-always shows data and it is not pushed out of window arbitrarily.
    Thanks,
    Steve  
    Solved!
    Go to Solution.

    OK- lets start back at the beginning.  I have a few questions...
    WHy does incoming txt get placed at top of txt box and then scroll up?  why would it make more sense to input at the bottom and scroll toward the top.  I have created this huge txt box that appears to be impossible to use.
    I have attached example of txt boxes I have tried, and pic of VI I have edited.  Bad marks for uglyness....
    Attachments:
    Capture_VI.JPG ‏117 KB
    Capture_VI2.JPG ‏133 KB

  • Window Goes Off-Screen When Mouse arrow Is Moved To Upper Right Hand Corner

    It seems like this happened recently. When the mouse is moved and pointed to the upper right hand corner of the screen everything displayed goes off-screen to the right and left sides. The edge of the window is shown on the right side and a shadow on the left side- when I click on those everything pops back on-screen. I have a bad habit of moving my mouse quickly and this has become annoying.
    I thought it may have been a "Hot Corner" but I checked and this feature is not enabled(in Expose/Dashboard)
    How do I disable this feature?
    Thank you in advance.
    Steve

    Hello Steve:
    It definitely sounds like the hot corner "all windows" is enabled. There is a preference file that needs to be trashed, but I cannot figure out which one (no help to you).
    Be sure that none of the hot corners are enabled and then restart.
    You might also try resetting PRAM (although I do not think that will do anything).
    Barry

  • HT2188 I bought my iPhone 4s Nov. 20.  I updated immediately to ios6.0 and cannot make it through even 1 day without the battery going down to almost zero.  Thats with apps closed, wifi off, screen off, etc.  It's a horror.  I have to constantly keep char

    I purchased an iPhone 4s on Nov. 20th.  I immediately had to update the software to ios 6.0.1.  I cannot even get through 1 day without the phone battery losing all power.  It loses 10-20% per hour, and that's with apps closed, wifi off, bluetooth off, screen dark, updates current, etc.  You can hold the phone in your hand and watch the power go down.  It also gets very warm.  I have to charge it once or twice a day so I have it when I need it.
    I took it in to the Sprint store for diagnostics to see if there was something wrong with the phone.  They said the phone is ok, but one of the agents said it's the last update - he has had problems ever since.  He said he thought they are working on fixing it & we should be getting another update to fix it.  Is this true?  I sure hope so!  They also showed me how to reboot the phone, especially when it gets so warm.  Is there anything else I need to do?  Please help!
    This is my first iPhone and I am very frustrated and disappointed in Apple.  If it's the software, I would think they would be frantically trying to fix it.  This phone was not the cheapest phone, so the battery life should be better!

    After some troubleshooting, I decided to order a new battery.  I replaced the battery and was then able to get it to restore, however--after I restore it and it comes time to restart the phone, it gets stuck and doesn't turn on.
    Sorry, your repair ruined the iPhone.
    She does not have apple care and even though she loved this device, she isn't going to buy another iPhone because of all the problems shes had with this one (it's just over a year old).
    After you ruined the iPhone with DIY, Apple won't touch it anymore. You should have asked before all these had happened.
    I'm an android user myself and I love rooting/flashing new ROMS, so if jailbreaking her phone or doing some kind of super-restore with 3rd party programs might help, I'm all for it-
    Yeah, all Android user can think of is Jailbreaking, read this: http://support.apple.com/kb/HT3743

  • Application off screen - Mac OS X 10.7

    Application is off screen. Happens after using 27inch display. Clearly a resolution issue. Tried everything including playing with the resolution, etc. After looking at several discussions and forums the one that works on my Macbook Air https://discussions.apple.com/message/8012940?messageID=8012940#8012940 does not work on my recently purchased (2 weeks) Macbook Pro 15inch.
    After running applescript editor I get this error: error "System Events got an error: Access for assistive devices is disabled." number -25211
    Anyone else getting this too?
    This is the script Im running.
    -- Example list of processes to ignore: {"xGestures"} or {"xGestures", "OtherApp", ...}
    property processesToIgnore : {}
    -- Get the size of the Display(s), only useful if there is one display
    -- otherwise it will grab the total size of both displays
    tell application "Finder"
              set _b to bounds of window of desktop
              set screen_width to item 3 of _b
              set screen_height to item 4 of _b
    end tell
    tell application "System Events"
              set allProcesses to application processes
              set _results to ""
              repeat with i from 1 to count allProcesses
                        set doIt to 1
                        repeat with z from 1 to count processesToIgnore
                                  if process i = process (item z of processesToIgnore) then
                                            set doIt to 0
                                  end if
                        end repeat
                        if doIt = 1 then
                                  tell process i
                                            repeat with x from 1 to (count windows)
                                                      set winPos to position of window x
                                                      set _x to item 1 of winPos
                                                      set _y to item 2 of winPos
                                                      if (_x < 0 or _y < 0 or _x > screen_width or _y > screen_height) then
                                                                set position of window x to {0, 22}
                                                      end if
                                            end repeat
                                  end tell
                        end if
              end repeat
    end tell

    It sounds like you were running a second display in extended desktop mode.
    If the adapter and/or cable for the second monitor is still attached, it can fool the Mac into believing the second monitor is still present. Detaching that cable/adaptr and then restarting should fix it.
    You can also try going to System Preferences > Monitors and change the setup from extended mode to mirror mode.

  • How to turn off screen shot flash

    How do you to turn off screen shot flash?

    Have you tried Clamshell Mode?
    http://support.apple.com/kb/ht3131
    Ciao.

  • How to turn off screen on Macbook Air when connected to Computer LeD monitor?

    How to turn off screen on Macbook Air when connected to Led monitor screen?

    The only way you can turn it off is to close the lid - so you would need an external wired or wireless keyboard and mouse/trackpad attached.
    Matt

  • How to turn off screen while computer is on an hdmi tv/projector hook up

    How to turn off screen while computer is on an hdmi tv/projector hook up?

    Have you tried Clamshell Mode?
    http://support.apple.com/kb/ht3131
    Ciao.

Maybe you are looking for