White spaces issue when applet is launched from Browser

I am trying to open HTML file (generated by net beans) to launch applet using window.open function.
The applet is launching fine but white spaces are coming on top and left side of the applet.
Any idea on how to remove these white spaces?

You need a custom html template and to set the application size parameters to 100% width and height.
Not sure if this is possible using the NetBeans JavaFX project configuration options currently.
Have a look at the Ensemble sample and Ensemble sample code, it implements a custom html template and 100% size parameters.
http://www.oracle.com/technetwork/java/javafx/samples/index.html
A css reset will remove default padding from an html page.
http://yuilibrary.com/yui/docs/cssreset/
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.6.0/build/cssreset/cssreset-min.css">
The minimal reset required to remove margins around the edge of the page is:
html, body { 
    margin: 0; 
    overflow: hidden; 
    padding: 0;
}Documentation is on web based deployment templates and application size is:
http://docs.oracle.com/javafx/2/deployment/deployment_toolkit.htm#BABJHEJA
Note it doesn't talk about percentage sizes as this may be an undocumented feature, but I think if you set the width and height in the dtjava.App call to '100%', the app will fill the available area of a window.
A view source on the ensemble html =>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JavaFX 2.0 - Ensemble</title>
<SCRIPT src="./web-files/dtjava.js"></SCRIPT>
<script>
    function javafxEmbed_ensemble() {
        dtjava.embed(
                id : 'ensemble',
                url : 'Ensemble.jnlp',
                placeholder : 'javafx-app-placeholder',
                width : '100%',
                height : '100%',
                jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vamF2YWZ4LmNvbSIgaHJlZj0iRW5zZW1ibGUuam5scCI+DQogIDxpbmZvcm1hdGlvbj4NCiAgICA8dGl0bGU+RW5zZW1ibGU8L3RpdGxlPg0KICAgIDx2ZW5kb3I+ZGVtbzwvdmVuZG9yPg0KICAgIDxkZXNjcmlwdGlvbj5TYW1wbGUgSmF2YUZYIDIuMCBhcHBsaWNhdGlvbi48L2Rlc2NyaXB0aW9uPg0KICAgIDxvZmZsaW5lLWFsbG93ZWQvPg0KICA8L2luZm9ybWF0aW9uPg0KICA8cmVzb3VyY2VzPg0KICAgIDxqZng6amF2YWZ4LXJ1bnRpbWUgdmVyc2lvbj0iMi4yKyIgaHJlZj0iaHR0cDovL2phdmFkbC5zdW4uY29tL3dlYmFwcHMvZG93bmxvYWQvR2V0RmlsZS9qYXZhZngtbGF0ZXN0L3dpbmRvd3MtaTU4Ni9qYXZhZngyLmpubHAiLz4NCiAgPC9yZXNvdXJjZXM+DQogIDxyZXNvdXJjZXM+DQogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPg0KICAgIDxqYXIgaHJlZj0iRW5zZW1ibGUuamFyIiBzaXplPSI4ODQ4MTU0IiBkb3dubG9hZD0iZWFnZXIiIC8+DQogIDwvcmVzb3VyY2VzPg0KICA8YXBwbGV0LWRlc2MgIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBtYWluLWNsYXNzPSJjb20uamF2YWZ4Lm1haW4uTm9KYXZhRlhGYWxsYmFjayIgIG5hbWU9IkVuc2VtYmxlIiA+DQogICAgPHBhcmFtIG5hbWU9InJlcXVpcmVkRlhWZXJzaW9uIiB2YWx1ZT0iMi4yKyIvPg0KICA8L2FwcGxldC1kZXNjPg0KICA8amZ4OmphdmFmeC1kZXNjICB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgbWFpbi1jbGFzcz0iZW5zZW1ibGUuRW5zZW1ibGUyIiAgbmFtZT0iRW5zZW1ibGUiIC8+DQogIDx1cGRhdGUgY2hlY2s9ImJhY2tncm91bmQiLz4NCjwvam5scD4NCg=='
                javafx : '2.2+'
    <!-- Embed FX application into web page once page is loaded -->
    dtjava.addOnloadCallback(javafxEmbed_ensemble);
</script>
        <style>
            html, body { 
                margin: 0; 
                overflow: hidden; 
                padding: 0;
        </style>
        <script>
            function hashchanged(event) {
                var applet = document.getElementById('ensemble');
                if (applet != null) {
                    try {
                        applet.hashChanged(location.hash);
                    } catch (err) {
                        console.log("JS Exception when trying to pass hash to Ensmeble Applet: " + err);
        </script>
</head>
<body onhashchange="hashchanged(event)"><div id='javafx-app-placeholder'></div></body>
</html>

Similar Messages

  • JVM crashed when applet is loaded in browser

    when applet is loaded in browser after some time JVM crashedwith hs error log.
    i am using
    JRE 1.6.0_10,
    1GB RAM,
    XP SP3,
    IE6
    Error log
    # An unexpected error has been detected by Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d02bd1d, pid=6032, tid=4772
    # Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode windows-x86)
    # Problematic frame:
    # C [awt.dll+0x2bd1d]
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    It appears from the following statement that a native code process failed when called by the jvm.
    The crash happened outside the Java Virtual Machine in native code.Not much more can be said. The cause does not appear to Java code.

  • Multiple projects, yet one flash file launched from browser

    Hello everyone, I glad to be a part of this wonderful community.  I have a really sticky Captivate 4 problem, and I wanted to get my feelers out there now before I really need to get this done before the end of the week.  This question has to do with publishing.  I have 7 project files, and I created a "menu" slide at the end of each of them that look exactly the same.  In this particular slide, there are 7 'click boxes' spread throughout the page that launch all the other projects.  If you are wondering why I did this, it's because I'm trying to cut back on load time when a user click on any individual project.  Now, my programmer can only launch one .swf file from our webpage to get the first project started.  So, does this mean Captivate will dynamically handle launching all of the other projects(assuming multiple flash files are created) when they are launched from these "menu" slides?  I'm a bit confused.  I'm likely confusing some of you as well.  It is hard to put the problem into writing.  Please help!

    Okay, so lets look at the problem, shall we?
    You created seven projects. But you later asked:
    So, does this mean Captivate will dynamically handle launching all of the other projects (assuming multiple flash files are created) when they are launched from these "menu" slides?
    First off, with seven different projects, you end up with seven different outputs. Assuming you are using Captivate in the basic form, you will end up with seven different SWF files and seven different HTM files that need to be factored into things. You may have more files than that, depending on your options used.
    When you create the links using the Click Boxes, hopefully you used the option: Open other project. This means that when the user clicks, the other SWF/HTM or EXE (depending on output) will be launched.
    I'm sure you will have other questions. So just post back either in threads of their own or by replying to this thread.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Extra White Space issue

    Hi, I am currently building a website in Adobe Muse, and am really enjoying it.  I have encountered a few differences between what I designed and what the site actually looks like and have been able to find solutions to all but one.  The home page has just a header and footer and an Adobe Edge Animation.  However, there is extra white space apearing underneath the animation (above the footer). Everything looks fine in the design mode, but even in preview there is extra space.  I tried uploading it to our ftp, thinking that might be the issue (as the animation doesn't show in the preview mode), but the extra space is still there.  I tried moving the Social media icons, thinking they might be causing it.  I have looked to see if maybe there is a text box, or empty shape that is causing the discrepency, but I can't find anything.  Any suggestions?
    Here is the screen capture of the design mode:
    Here is the screen capture of it in the browser:
    Any help would be greatly appreciated.

    Hi Razorcs,
    I have checked your file and the white space is coming from the page that you are calling in the iframe. I have seen that most browsers do not respond well, when the widht and the height of the iframe is specified in percent.
    As a fix you have to give manual width and height to the iframe and that should take care of it.
    For example, try something like 412px, which is the height of the edge content,
    Regards,
    Abhishek Maurya

  • Castor beans white space issue...

    So I have this code that mmimmicks my java objects for some classes I have that was built based off of a schema using castor. This code exports some data from a database to a .xml file just beautifully, but importing it (Reading back in the straight up xml) is another story...
    imagine I have a xml file that contains some members that act as names for their java object brothers:
    <xmlWasJavaObjectHere>
    <xmlSimpleName>AIRBORNE/STATIC LINE</xmlSimpleName>
    </xmlWasJavaObjectHere>
    now imagine the xml file repeating a ton of such objects(after all it was exported from a database that was essentially an array of such objects). So we have:
    ...some other object names here...
    <xmlWasJavaObjectHere>
    <xmlSimpleName>AIRBORNE/STATIC LINE</xmlSimpleName>
    </xmlWasJavaObjectHere>
    <xmlWasJavaObjectHere>
    <xmlSimpleName>AIRBORNE/STATIC LINE</xmlSimpleName>
    </xmlWasJavaObjectHere>
    <xmlWasJavaObjectHere>
    <xmlSimpleName>AIRBORNE/STATIC LINE</xmlSimpleName>
    </xmlWasJavaObjectHere>
    <xmlWasJavaObjectHere>
    <xmlSimpleName>AIRBORNE/STATIC LINE</xmlSimpleName>
    </xmlWasJavaObjectHere>
    ...some more objects here with different names.
    So now this exports just like this, just fine. The problem is when I read back in the data using the castor bean unmarshaller, it reads into the member as such:
    myXMLObj.getSimpleName(); returns
    AIRBORNE/STATIC LINE
    AIRBORNE/STATIC LINE
    AIRBORNE/STATIC LINE
    AIRBORNE/STATICLINE
    AIRBORNE/STATICLINE
    AIRBORNE/STATICLINE
    So it returns it right for the first few instanceus of it from the xml then it misses a white space(obviously this breaks importing this back into the database.) I am no xml/java/castor guru but I cannot figure out why it decides to loose white space (id say it does this randomly, but it starts doing it on the same index (item count whatever) every single time. And its the same name,does anyone have any ideas? Im pulling my hair out. Perhaps my naming scheme in the xsd was big depature from what it should of been. (Cause i had other issues working with XMLBeans and web services on naming some complexTypes (or was it elements?) with a upper case, when it should be lower case (and the name was getting mangaled).
    oh well thats all I have im totally out of ideasm, so perhaps people have seen this before and confirm its some wierd quirk of using castor beans to load in xml data back to our objects (and i Did double check, the white space is missing in the actual xml object hta tis populated with an unmarshall.), any help will be appreciated. Thanks,
    Shane
    thanks in advance,
    Shane

    Hm, well 2 possible ideas:
    1. There is a line of code in the middle of your tabbed panels that shouldn't be there.  It reads at follows
    <!-- BEGIN: Constant Contact Bubble Opt-in Email List Form --> <div align="center"></div>
    <!-- END: SafeSubscribe -->
    2. In this code, do you need the clear:both?
    <div style="clear:both; font-size: 18px; color: #0055A6; font-weight: bold;">
                       <blockquote>
                         <p>Follow Us:

  • Could not initiate SSL connection when DS is launched from Eclipse

    Hello,
    I am wondering whether anyone has faced this issue connecting to the BIP with https when Design Studio is launched from the Eclipse IDE.
    The URL is something like : https://myservername.domain.net/dswsbobje/services/Session
    We get the following error message when entering the URL : "Could not initiate SSL connection. Check the Web Service Url"
    However, when Design Studio is launched directly, the same URL works fine and we can connect to the BIP normally.
    I would imagine something is missing in the Eclipse configuration or there is an issue elsewhere. I did not find anything relevant in the SDK guide.
    We checked the following SAP notes :
    1807142 - How to enable HTTPS/SSL Designer against BIP
    -> Web service configured properly, the URL works fine and it works when Design Studio is started without Eclipse
    1975475 - Unable to select authentication method in BIP logon dialog of SAP Design Studio
    Tried the solution : set to Direct. Tried to remove proxy entries in IE. No improvement. Also, I tried to set the connectivity to Direct in the Eclipse. But, no luck.
    Software :
    Design Studio 1.2 SP01 + SDK 1.2 SP01
    BI 4.0 SP06
    Java EE IDE (Kepler)  Version: 2.0.1.20130919-0803
    Java JRE 1.6.0.35. It's old, I know...
    Thanks in advance.
    Joel

    Hi Joel,
    any progress?
    do you use a self signed certficate?
    Kind regards
    Frank

  • White space issue in displaying page on Curve 8330

    Hi All
    I am using a lot of <div> tags on my jsp page to be displayed on Curve 8330 I am getting unnecessary white space after the last <div> tag . I have tried to set <div> and <body> tag style attributes like padding and margins to "0px" but with no luck.
    Would really appreciate help on this. 
    thx 

    Hi,
    File to Idoc and Idoc used is ORDERS05.
    Is IDOC occurence on target side is unbounded or 0..1???
    If multiple occurence means then u need to change the IDOC structure, just change the occurence to o.unbounded.
    Whenvever i am opening the payload with notepad i am able to see the space as 70th character and whenever i am checking the XML the space has been truncated for same.
    I understand from above that the payload is correct with 70th character is space , but when u see the XML Payload in moni, the size is less or the white spaces are trimmed out.
    So u neeed to add extra attribute on sender FCC
    node.fieldContentFormatting  nothing
    by default it is trim u need to change as nothing..
    Let us know the result
    Babu

  • Issue when uploading Sales data from DSO to Cube.

    Dear All,
    I have an issue when I am uploading Sales data from DSO to Cube.  I am using BI 7.0 and I have uploaded all sales document level data to my DSO.  Then I use a transformation rule to calculate the Sales Value when I am doing DTP to cube.  Cube has customer wise aggregation data.
    In DSO I have NetPrice(KF) and Delivered_QTY(KF).  I do a simple multiplication routine in the transformation from DSO to Cube.
    RESULT =   SOURCE_FIELDS-NET_PRICE * SOURCE_FIELDS-DLV_QTY .
    At the moment I use Active Table(With out Archive) on the DSO to get the data since this is my first load.
    Issue is that the figure (Sales Value) in the cube is incorrect. I am getting a very large values which is impossible.
    Can someone please help me.
    Shanka

    Hi,
    are you sure that cube has customer wise aggregated data..since it will always aggregate the values of the key figures for the same set of characters...
    did you checked the values for the key figures as well and if even they are inflated or is the problem with this key figure only.
    During the data load the records may aggregates first for the same values of characters and then multiplication will be happening....if that is the case then you may have to multiply the values before storing it in the data package and then let it aggregate....can be achived through start routine...
    but first verify if other key figures are also having the same issue.
    Thanks
    Ajeet

  • White space issues between content and footer.

    I am having white space/page length issue between the end of my content and the footer.
    I have read the forums and tried changing the page length minium height to 800 and then I
    unchecked the sticky footer in page properties on both the master page and the content page itself.
    Here's a link to one of my pages.  http://www.ueonline.com/rohs-info.html
    This page has very little content and you can see the white space.
    Any help is appreciated.

    This may be a little dated for a reply, and I'm not 100% sure your issue is the same as mine, but I discovered that unchecking the sticky footer option in site properties solved the problem. I should note that the website I was building for a client was über simple, and while disabling that function solved the headache in my own project, it may incur unwanted results in others, depending on the complexity.
    DTA

  • Issue when Calling the RFC from external system

    Hi,
    I have created one RFC, in which I am using one function module to get the material customer status.
    Functional Module name is "QC01_BATCH_VALUES_READ".
    When I run this in SAP, it is giving a value for Cusotmer Status. But when this RFC is called from .Net system it is not returning any value for this field.
    Even I used a different function module 'CLAF_CLASSIFICATION_OF_OBJECTS' for the same, in this also in SAP it is doing good, but when it is called from .Net, the program is giving dump.
    Please help me to resolve this issue
    Thanks
    Ravi

    Hi Ravi,
    Issue can be either in the .NET program or in the RFC destination creation.
    1)
    Check whether data types of .NET program which is calling the SAP function module are correct. 
    If there are issues with data types,  program dont report if you dont so explicitly.
    2) Check whether RFC destination you are giving in your .NET program is correctly configured in
        SAP , verify by testing the same.
    Apart from above two reasons, I dont see any other major reasons for not getting correct results.
    Regards
    Krishna

  • Need help with white spaces/halos when creating PNG

    I'm using Illustrator CS6 on Windows 7. I'm trying to create some pushpins that will go on an online map. I've created the graphic in Illustrator and everything looks nice and sharp. My problem is when I try to convert this .ai file to png. The ai file is set up on 8.5 x 11 artboard with the graphic taking up the whole artboard; the final size of the png needs to be 20x34 pixels at 72 dpi.
    I've tried both Save for Web and Export but no matter what I do, when I open the png in Photoshop, there is a white space between the grey pushpin and the black stroke as well as around the outside of the S. No matter what I've tried, I can't get rid of these unwanted white spaces/halos. Is there a setting I'm missing somewhere? The large image below is how it looks in Illustrator; the small image is the png opened in Photoshop. How can I get the small png to be as crisp as the large ai file? Thanks.

    mc-mark,
    Are you sure the artwork is contained within whole pixels on the Artboard?
    One way to obtain that is to move the artwork so that the Transform panel tells you that the X and Y values of the lower left corner (or centre or something else) are whole pixels/points; another way is to tick Align to Pixel grid  in the Transform panel, but I am afraid that may distort the artwork when used at this stage.

  • Space issues when updating Infinity Blade

    Hey all,
    I've got Infinity Blade, and it's a big app (891MB). When I go to update it, the Infinity Blade icon had a blue bar fill up until it gets to "Installing" then it says it can't do it, I don't have enough space. Now I've got 1.3 GB of space left on my iPad, so even if it was downloading a full new copy there should be enough space left. What's the deal here?
    Any input appreciated, Thanks,
    Dan Perkins

    That's a shame... I often run into the issue when I'm at work and (being impatient) I really want to update and app now. Unfortunately, I've got the 16gb and it's almost ALL apps taking up the space, as opposed to videos. So I can't delete apps and reinstall because I'll lose their data. And I have very little music. I do have a fair bit of family pics but I'd have to go through and delete a bunch 1 by 1.
    Maybe it is time that I start letting go of some of these apps that are cool but I'm REALLY not ever going to use them / play them again
    Thanks for the input.
    dp

  • Why is the picture of the flash banner or video of the flash player showing only a white space, and when I click on it, it plays only the sound, but no picture?

    On other browsers the videos are playing. But in firefox4 I don't see the video at all. But if I click in the center of the white space the video starts to play so I hear the sound.
    Since this was the case I upgraded all my plugins and yet no change.
    The websites are: http://www.bibletube.tv/
    http://www.comeandfollow.me/
    but in fact on many other website I find the same problem. Some flash works and other don't

    Maybe these will help:
    https://discussions.apple.com/message/17677533#17677533
    https://discussions.apple.com/message/18324129#18324129
    https://discussions.apple.com/message/18203126#18203126

  • How do I convert this Applet to launch from a JFrame instead??

       A simple program where the user can sketch curves and shapes in a
       variety of colors on a variety of background colors.  The user selects
       a drawing color form a pop-up menu at the top of the
       applet.  If the user clicks "Set Background", the background
       color is set to the current drawing color and the drawing
       area is filled with that color.  If the user clicks "Clear",
       the drawing area is just filled with the current background color.
       The user selects the shape to draw from another pop-up menu at the
       top of the applet.  The user can draw free-hand curves, straight
       lines, and one of six different types of shapes.
       The user's drawing is saved in an off-screen image, which is
       used to refresh the screen when repainting.  The picture is
       lost if the applet changes size, however.
       This file defines two classes, SimplePaint3,class, and
       class, SimplePaint3$Display.class.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class SimplePaint3 extends JApplet {
            // The main applet class simply sets up the applet.  Most of the
            // work is done in the Display class.
       JComboBox colorChoice, figureChoice;  // Pop-up menus, defined as instance
                                             // variables so that the Display
                                             // class can see them.
       public void init() {
          setBackground(Color.gray);
          getContentPane().setBackground(Color.gray);
          Display canvas = new Display();  // The drawing area.
          getContentPane().add(canvas,BorderLayout.CENTER);
          JPanel buttonBar = new JPanel();       // A panel to hold the buttons.
          buttonBar.setBackground(Color.gray);
          getContentPane().add(buttonBar, BorderLayout.SOUTH);
          JPanel choiceBar = new JPanel();       // A panel to hole the pop-up menus
          choiceBar.setBackground(Color.gray);
          getContentPane().add(choiceBar, BorderLayout.NORTH);
          JButton fill = new JButton("Set Background");  // The first button.
          fill.addActionListener(canvas);
          buttonBar.add(fill);
          JButton clear = new JButton("Clear");   // The second button.
          clear.addActionListener(canvas);
          buttonBar.add(clear);
          colorChoice = new JComboBox();  // The pop-up menu of colors.
          colorChoice.addItem("Black");
          colorChoice.addItem("Red");
          colorChoice.addItem("Green");
          colorChoice.addItem("Blue");
          colorChoice.addItem("Cyan");
          colorChoice.addItem("Magenta");
          colorChoice.addItem("Yellow");
          colorChoice.addItem("White");
          colorChoice.setBackground(Color.white);
          choiceBar.add(colorChoice);
          figureChoice = new JComboBox();  // The pop-up menu of shapes.
          figureChoice.addItem("Curve");
          figureChoice.addItem("Straight Line");
          figureChoice.addItem("Rectangle");
          figureChoice.addItem("Oval");
          figureChoice.addItem("RoundRect");
          figureChoice.addItem("Filled Rectangle");
          figureChoice.addItem("Filled Oval");
          figureChoice.addItem("Filled RoundRect");
          figureChoice.setBackground(Color.white);
          choiceBar.add(figureChoice);
       }  // end init()
       public Insets getInsets() {
              // Specify how wide a border to leave around the edges of the applet.
          return new Insets(3,3,3,3);
       private class Display extends JPanel
                  implements MouseListener, MouseMotionListener, ActionListener {
               // Nested class Display represents the drawing surface of the
               // applet.  It lets the user use the mouse to draw colored curves
               // and shapes.  The current color is specified by the pop-up menu
               // colorChoice.  The current shape is specified by another pop-up menu,
               // figureChoice.  (These are instance variables in the main class.)
               // The panel also listens for action events from buttons
               // named "Clear" and "Set Background".  The "Clear" button fills
               // the panel with the current background color.  The "Set Background"
               // button sets the background color to the current drawing color and
               // then clears.  These buttons are set up in the main class.
          private final static int
                      BLACK = 0,
                      RED = 1,            // Some constants to make
                      GREEN = 2,          // the code more readable.
                      BLUE = 3,           // These numbers code for
                      CYAN = 4,           // the different drawing colors.
                      MAGENTA = 5,
                      YELLOW = 6,
                      WHITE = 7;
          private final static int
                     CURVE = 0,
                     LINE = 1,
                     RECT = 2,               // Some constants that code
                     OVAL = 3,               // for the different types of
                     ROUNDRECT = 4,          // figure the program can draw.
                     FILLED_RECT = 5,
                     FILLED_OVAL = 6,
                     FILLED_ROUNDRECT = 7;
          /* Some variables used for backing up the contents of the panel. */
          Image OSI;  // The off-screen image (created in checkOSI()).
          int widthOfOSI, heightOfOSI;  // Current width and height of OSI.  These
                                        // are checked against the size of the applet,
                                        // to detect any change in the panel's size.
                                        // If the size has changed, a new OSI is created.
                                        // The picture in the off-screen image is lost
                                        // when that happens.
          /* The following variables are used when the user is sketching a
             curve while dragging a mouse. */
          private int mouseX, mouseY;   // The location of the mouse.
          private int prevX, prevY;     // The previous location of the mouse.
          private int startX, startY;   // The starting position of the mouse.
                                        // (Not used for drawing curves.)
          private boolean dragging;     // This is set to true when the user is drawing.
          private int figure;    // What type of figure is being drawn.  This is
                                 //    specified by the figureChoice menu.
          private Graphics dragGraphics;  // A graphics context for the off-screen image,
                                          // to be used while a drag is in progress.
          private Color dragColor;  // The color that is used for the figure that is
                                    // being drawn.
          Display() {
                 // Constructor.  When this component is first created, it is set to
                 // listen for mouse events and mouse motion events from
                 // itself.  The initial background color is white.
             addMouseListener(this);
             addMouseMotionListener(this);
             setBackground(Color.white);
          private void drawFigure(Graphics g, int shape, int x1, int y1, int x2, int y2) {
                // This method is called to do ALL drawing in this applet!
                // Draws a shape in the graphics context g.
                // The shape paramter tells what kind of shape to draw.  This
                // can be LINE, RECT, OVAL, ROUNTRECT, FILLED_RECT,
                // FILLED_OVAL, or FILLED_ROUNDRECT.  (Note that a CURVE is
                // drawn by drawing multiple LINES, so the shape parameter is
                // never equal to CURVE.)  For a LINE, a line is drawn from
                // the point (x1,y1) to (x2,y2).  For other shapes,  the
                // points (x1,y1) and (x2,y2) give two corners of the shape
                // (or of a rectangle that contains the shape).
             if (shape == LINE) {
                   // For a line, just draw the line between the two points.
                g.drawLine(x1,y1,x2,y2);
                return;
             int x, y;  // Top left corner of rectangle that contains the figure.
             int w, h;  // Width and height of rectangle that contains the figure.
             if (x1 >= x2) {  // x2 is left edge
                x = x2;
                w = x1 - x2;
             else {          // x1 is left edge
                x = x1;
                w = x2 - x1;
             if (y1 >= y2) {  // y2 is top edge
                y = y2;
                h = y1 - y2;
             else {          // y1 is top edge.
                y = y1;
                h = y2 - y1;
             switch (shape) {   // Draw the appropriate figure.
                case RECT:
                   g.drawRect(x, y, w, h);
                   break;
                case OVAL:
                   g.drawOval(x, y, w, h);
                   break;
                case ROUNDRECT:
                   g.drawRoundRect(x, y, w, h, 20, 20);
                   break;
                case FILLED_RECT:
                   g.fillRect(x, y, w, h);
                   break;
                case FILLED_OVAL:
                   g.fillOval(x, y, w, h);
                   break;
                case FILLED_ROUNDRECT:
                   g.fillRoundRect(x, y, w, h, 20, 20);
                   break;
          private void repaintRect(int x1, int y1, int x2, int y2) {
                // Call repaint on a rectangle that contains the points (x1,y1)
                // and (x2,y2).  (Add a 1-pixel border along right and bottom
                // edges to allow for the pen overhang when drawing a line.)
             int x, y;  // top left corner of rectangle that contains the figure
             int w, h;  // width and height of rectangle that contains the figure
             if (x2 >= x1) {  // x1 is left edge
                x = x1;
                w = x2 - x1;
             else {          // x2 is left edge
                x = x2;
                w = x1 - x2;
             if (y2 >= y1) {  // y1 is top edge
                y = y1;
                h = y2 - y1;
             else {          // y2 is top edge.
                y = y2;
                h = y1 - y2;
             repaint(x,y,w+1,h+1);
          private void checkOSI() {
               // This method is responsible for creating the off-screen image.
               // It should be called before using the OSI.  It will make a new OSI if
               // the size of the panel changes.
             if (OSI == null || widthOfOSI != getSize().width || heightOfOSI != getSize().height) {
                    // Create the OSI, or make a new one if panel size has changed.
                OSI = null;  // (If OSI already exists, this frees up the memory.)
                OSI = createImage(getSize().width, getSize().height);
                widthOfOSI = getSize().width;
                heightOfOSI = getSize().height;
                Graphics OSG = OSI.getGraphics();  // Graphics context for drawing to OSI.
                OSG.setColor(getBackground());
                OSG.fillRect(0, 0, widthOfOSI, heightOfOSI);
                OSG.dispose();
          public void paintComponent(Graphics g) {
               // Copy the off-screen image to the screen,
               // after checking to make sure it exists.  Then,
               // if a shape other than CURVE is being drawn,
               // draw it on top of the image from the OSI.
             checkOSI();
             g.drawImage(OSI, 0, 0, this);
             if (dragging && figure != CURVE) {
                g.setColor(dragColor);
                drawFigure(g,figure,startX,startY,mouseX,mouseY);
          public void actionPerformed(ActionEvent evt) {
                  // Respond when the user clicks on a button.  The
                  // command must be either "Clear" or "Set Background".
             String command = evt.getActionCommand();
             checkOSI();
             if (command.equals("Set Background")) {
                    // Set background color before clearing.
                    // Change the selected color so it is different
                    // from the background color.
                setBackground(getCurrentColor());
                if (colorChoice.getSelectedIndex() == BLACK)
                   colorChoice.setSelectedIndex(WHITE);
                else
                   colorChoice.setSelectedIndex(BLACK);
             Graphics g = OSI.getGraphics();
             g.setColor(getBackground());
             g.fillRect(0,0,getSize().width,getSize().height);
             g.dispose();
             repaint();
          private Color getCurrentColor() {
                   // Check the colorChoice menu to find the currently
                   // selected color, and return the appropriate color
                   // object.
             int currentColor = colorChoice.getSelectedIndex();
             switch (currentColor) {
                case BLACK:
                   return Color.black;
                case RED:
                   return Color.red;
                case GREEN:
                   return Color.green;
                case BLUE:
                   return Color.blue;
                case CYAN:
                   return Color.cyan;
                case MAGENTA:
                   return Color.magenta;
                case YELLOW:
                   return Color.yellow;
                default:
                   return Color.white;
          public void mousePressed(MouseEvent evt) {
                  // This is called when the user presses the mouse on the
                  // panel.  This begins a draw operation in which the user
                  // sketches a curve or draws a shape.  (Note that curves
                  // are handled differently from other shapes.  For CURVE,
                  // a new segment of the curve is drawn each time the user
                  // moves the mouse.  For the other shapes, a "rubber band
                  // cursor" is used.  That is, the figure is drawn between
                  // the starting point and the current mouse location.)
             if (dragging == true)  // Ignore mouse presses that occur
                 return;            //    when user is already drawing a curve.
                                    //    (This can happen if the user presses
                                    //    two mouse buttons at the same time.)
             prevX = startX = evt.getX();  // Save mouse coordinates.
             prevY = startY = evt.getY();
             figure = figureChoice.getSelectedIndex();
             dragColor = getCurrentColor();        
             dragGraphics = OSI.getGraphics();
             dragGraphics.setColor(dragColor);
             dragging = true;  // Start drawing.
          } // end mousePressed()
          public void mouseReleased(MouseEvent evt) {
                  // Called whenever the user releases the mouse button.
                  // If the user was drawing a shape, we make the shape
                  // permanent by drawing it to the off-screen image.
              if (dragging == false)
                 return;  // Nothing to do because the user isn't drawing.
              dragging = false;
              mouseX = evt.getX();
              mouseY = evt.getY();
              if (figure == CURVE) {
                     // A CURVE is drawn as a series of LINEs
                  drawFigure(dragGraphics,LINE,prevX,prevY,mouseX,mouseY);
                  repaintRect(prevX,prevY,mouseX,mouseY);
              else if (figure == LINE) {
                 repaintRect(startX,startY,prevX,prevY);
                 if (mouseX != startX || mouseY != startY) {
                       // Draw the line only if it has non-zero length.
                    drawFigure(dragGraphics,figure,startX,startY,mouseX,mouseY);
                    repaintRect(startX,startY,mouseX,mouseY);
              else {
                 repaintRect(startX,startY,prevX,prevY);
                 if (mouseX != startX && mouseY != startY) {
                       // Draw the shape only if both its height
                       // and width are both non-zero.
                    drawFigure(dragGraphics,figure,startX,startY,mouseX,mouseY);
                    repaintRect(startX,startY,mouseX,mouseY);
              dragGraphics.dispose();
              dragGraphics = null;
          public void mouseDragged(MouseEvent evt) {
                   // Called whenever the user moves the mouse while a mouse button
                   // is down.  If the user is drawing a curve, draw a segment of
                   // the curve on the off-screen image, and repaint the part
                   // of the panel that contains the new line segment.  Otherwise,
                   // just call repaint and let paintComponent() draw the shape on
                   // top of the picture in the off-screen image.
              if (dragging == false)
                 return;  // Nothing to do because the user isn't drawing.
              mouseX = evt.getX();   // x-coordinate of mouse.
              mouseY = evt.getY();   // y=coordinate of mouse.
              if (figure == CURVE) {
                     // A CURVE is drawn as a series of LINEs.
                 drawFigure(dragGraphics,LINE,prevX,prevY,mouseX,mouseY);
                 repaintRect(prevX,prevY,mouseX,mouseY);
              else {
                    // Repaint two rectangles:  The one that contains the previous
                    // version of the figure, and the one that will contain the
                    // new version.  The first repaint is necessary to restore
                    // the picture from the off-screen image in that rectangle.
                 repaintRect(startX,startY,prevX,prevY);
                 repaintRect(startX,startY,mouseX,mouseY);
              prevX = mouseX;  // Save coords for the next call to mouseDragged or mouseReleased.
              prevY = mouseY;
          } // end mouseDragged.
          public void mouseEntered(MouseEvent evt) { }   // Some empty routines.
          public void mouseExited(MouseEvent evt) { }    //    (Required by the MouseListener
          public void mouseClicked(MouseEvent evt) { }   //    and MouseMotionListener
          public void mouseMoved(MouseEvent evt) { }     //    interfaces).
       } // end nested class Display
    } // end class SimplePaint3

    Im quite the novice, how exactly do I go about doing that. What I did was to put both in diff files but I got errors saying that they cant find colorChoice, figureChoice in the Display class.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Simple extends JFrame implements Display{
            // The main applet class simply sets up the applet.  Most of the
            // work is done in the Display class.
       JComboBox colorChoice, figureChoice;  // Pop-up menus, defined as instance
                                             // variables so that the Display
                                             // class can see them.
       public void init() {
          setBackground(Color.gray);
          getContentPane().setBackground(Color.gray);
          Display canvas = new Display();  // The drawing area.
          getContentPane().add(canvas,BorderLayout.CENTER);
          JPanel buttonBar = new JPanel();       // A panel to hold the buttons.
          buttonBar.setBackground(Color.gray);
          getContentPane().add(buttonBar, BorderLayout.SOUTH);
          JPanel choiceBar = new JPanel();       // A panel to hole the pop-up menus
          choiceBar.setBackground(Color.gray);
          getContentPane().add(choiceBar, BorderLayout.NORTH);
          JButton fill = new JButton("Set Background");  // The first button.
          fill.addActionListener(canvas);
          buttonBar.add(fill);
          JButton clear = new JButton("Clear");   // The second button.
          clear.addActionListener(canvas);
          buttonBar.add(clear);
          colorChoice = new JComboBox();  // The pop-up menu of colors.
          colorChoice.addItem("Black");
          colorChoice.addItem("Red");
          colorChoice.addItem("Green");
          colorChoice.addItem("Blue");
          colorChoice.addItem("Cyan");
          colorChoice.addItem("Magenta");
          colorChoice.addItem("Yellow");
          colorChoice.addItem("White");
          colorChoice.setBackground(Color.white);
          choiceBar.add(colorChoice);
          figureChoice = new JComboBox();  // The pop-up menu of shapes.
          figureChoice.addItem("Curve");
          figureChoice.addItem("Straight Line");
          figureChoice.addItem("Rectangle");
          figureChoice.addItem("Oval");
          figureChoice.addItem("RoundRect");
          figureChoice.addItem("Filled Rectangle");
          figureChoice.addItem("Filled Oval");
          figureChoice.addItem("Filled RoundRect");
          figureChoice.setBackground(Color.white);
          choiceBar.add(figureChoice);
       }  // end init()
    } // end class SimplePaint3
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Display extends JPanel
                  implements MouseListener, MouseMotionListener, ActionListener {
               // Nested class Display represents the drawing surface of the
               // applet.  It lets the user use the mouse to draw colored curves
               // and shapes.  The current color is specified by the pop-up menu
               // colorChoice.  The current shape is specified by another pop-up menu,
               // figureChoice.  (These are instance variables in the main class.)
               // The panel also listens for action events from buttons
               // named "Clear" and "Set Background".  The "Clear" button fills
               // the panel with the current background color.  The "Set Background"
               // button sets the background color to the current drawing color and
               // then clears.  These buttons are set up in the main class.
          private final static int
                      BLACK = 0,
                      RED = 1,            // Some constants to make
                      GREEN = 2,          // the code more readable.
                      BLUE = 3,           // These numbers code for
                      CYAN = 4,           // the different drawing colors.
                      MAGENTA = 5,
                      YELLOW = 6,
                      WHITE = 7;
          private final static int
                     CURVE = 0,
                     LINE = 1,
                     RECT = 2,               // Some constants that code
                     OVAL = 3,               // for the different types of
                     ROUNDRECT = 4,          // figure the program can draw.
                     FILLED_RECT = 5,
                     FILLED_OVAL = 6,
                     FILLED_ROUNDRECT = 7;
          /* Some variables used for backing up the contents of the panel. */
          Image OSI;  // The off-screen image (created in checkOSI()).
          int widthOfOSI, heightOfOSI;  // Current width and height of OSI.  These
                                        // are checked against the size of the applet,
                                        // to detect any change in the panel's size.
                                        // If the size has changed, a new OSI is created.
                                        // The picture in the off-screen image is lost
                                        // when that happens.
          /* The following variables are used when the user is sketching a
             curve while dragging a mouse. */
          private int mouseX, mouseY;   // The location of the mouse.
          private int prevX, prevY;     // The previous location of the mouse.
          private int startX, startY;   // The starting position of the mouse.
                                        // (Not used for drawing curves.)
          private boolean dragging;     // This is set to true when the user is drawing.
          private int figure;    // What type of figure is being drawn.  This is
                                 //    specified by the figureChoice menu.
          private Graphics dragGraphics;  // A graphics context for the off-screen image,
                                          // to be used while a drag is in progress.
          private Color dragColor;  // The color that is used for the figure that is
                                    // being drawn.
          Display() {
                 // Constructor.  When this component is first created, it is set to
                 // listen for mouse events and mouse motion events from
                 // itself.  The initial background color is white.
             addMouseListener(this);
             addMouseMotionListener(this);
             setBackground(Color.white);
          private void drawFigure(Graphics g, int shape, int x1, int y1, int x2, int y2) {
                // This method is called to do ALL drawing in this applet!
                // Draws a shape in the graphics context g.
                // The shape paramter tells what kind of shape to draw.  This
                // can be LINE, RECT, OVAL, ROUNTRECT, FILLED_RECT,
                // FILLED_OVAL, or FILLED_ROUNDRECT.  (Note that a CURVE is
                // drawn by drawing multiple LINES, so the shape parameter is
                // never equal to CURVE.)  For a LINE, a line is drawn from
                // the point (x1,y1) to (x2,y2).  For other shapes,  the
                // points (x1,y1) and (x2,y2) give two corners of the shape
                // (or of a rectangle that contains the shape).
             if (shape == LINE) {
                   // For a line, just draw the line between the two points.
                g.drawLine(x1,y1,x2,y2);
                return;
             int x, y;  // Top left corner of rectangle that contains the figure.
             int w, h;  // Width and height of rectangle that contains the figure.
             if (x1 >= x2) {  // x2 is left edge
                x = x2;
                w = x1 - x2;
             else {          // x1 is left edge
                x = x1;
                w = x2 - x1;
             if (y1 >= y2) {  // y2 is top edge
                y = y2;
                h = y1 - y2;
             else {          // y1 is top edge.
                y = y1;
                h = y2 - y1;
             switch (shape) {   // Draw the appropriate figure.
                case RECT:
                   g.drawRect(x, y, w, h);
                   break;
                case OVAL:
                   g.drawOval(x, y, w, h);
                   break;
                case ROUNDRECT:
                   g.drawRoundRect(x, y, w, h, 20, 20);
                   break;
                case FILLED_RECT:
                   g.fillRect(x, y, w, h);
                   break;
                case FILLED_OVAL:
                   g.fillOval(x, y, w, h);
                   break;
                case FILLED_ROUNDRECT:
                   g.fillRoundRect(x, y, w, h, 20, 20);
                   break;
          private void repaintRect(int x1, int y1, int x2, int y2) {
                // Call repaint on a rectangle that contains the points (x1,y1)
                // and (x2,y2).  (Add a 1-pixel border along right and bottom
                // edges to allow for the pen overhang when drawing a line.)
             int x, y;  // top left corner of rectangle that contains the figure
             int w, h;  // width and height of rectangle that contains the figure
             if (x2 >= x1) {  // x1 is left edge
                x = x1;
                w = x2 - x1;
             else {          // x2 is left edge
                x = x2;
                w = x1 - x2;
             if (y2 >= y1) {  // y1 is top edge
                y = y1;
                h = y2 - y1;
             else {          // y2 is top edge.
                y = y2;
                h = y1 - y2;
             repaint(x,y,w+1,h+1);
          private void checkOSI() {
               // This method is responsible for creating the off-screen image.
               // It should be called before using the OSI.  It will make a new OSI if
               // the size of the panel changes.
             if (OSI == null || widthOfOSI != getSize().width || heightOfOSI != getSize().height) {
                    // Create the OSI, or make a new one if panel size has changed.
                OSI = null;  // (If OSI already exists, this frees up the memory.)
                OSI = createImage(getSize().width, getSize().height);
                widthOfOSI = getSize().width;
                heightOfOSI = getSize().height;
                Graphics OSG = OSI.getGraphics();  // Graphics context for drawing to OSI.
                OSG.setColor(getBackground());
                OSG.fillRect(0, 0, widthOfOSI, heightOfOSI);
                OSG.dispose();
          public void paintComponent(Graphics g) {
               // Copy the off-screen image to the screen,
               // after checking to make sure it exists.  Then,
               // if a shape other than CURVE is being drawn,
               // draw it on top of the image from the OSI.
             checkOSI();
             g.drawImage(OSI, 0, 0, this);
             if (dragging && figure != CURVE) {
                g.setColor(dragColor);
                drawFigure(g,figure,startX,startY,mouseX,mouseY);
          public void actionPerformed(ActionEvent evt) {
                  // Respond when the user clicks on a button.  The
                  // command must be either "Clear" or "Set Background".
             String command = evt.getActionCommand();
             checkOSI();
             if (command.equals("Set Background")) {
                    // Set background color before clearing.
                    // Change the selected color so it is different
                    // from the background color.
                setBackground(getCurrentColor());
                if (colorChoice.getSelectedIndex() == BLACK)
                   colorChoice.setSelectedIndex(WHITE);
                else
                   colorChoice.setSelectedIndex(BLACK);
             Graphics g = OSI.getGraphics();
             g.setColor(getBackground());
             g.fillRect(0,0,getSize().width,getSize().height);
             g.dispose();
             repaint();
          private Color getCurrentColor() {
                   // Check the colorChoice menu to find the currently
                   // selected color, and return the appropriate color
                   // object.
             int currentColor = colorChoice.getSelectedIndex();
             switch (currentColor) {
                case BLACK:
                   return Color.black;
                case RED:
                   return Color.red;
                case GREEN:
                   return Color.green;
                case BLUE:
                   return Color.blue;
                case CYAN:
                   return Color.cyan;
                case MAGENTA:
                   return Color.magenta;
                case YELLOW:
                   return Color.yellow;
                default:
                   return Color.white;
          public void mousePressed(MouseEvent evt) {
                  // This is called when the user presses the mouse on the
                  // panel.  This begins a draw operation in which the user
                  // sketches a curve or draws a shape.  (Note that curves
                  // are handled differently from other shapes.  For CURVE,
                  // a new segment of the curve is drawn each time the user
                  // moves the mouse.  For the other shapes, a "rubber band
                  // cursor" is used.  That is, the figure is drawn between
                  // the starting point and the current mouse location.)
             if (dragging == true)  // Ignore mouse presses that occur
                 return;            //    when user is already drawing a curve.
                                    //    (This can happen if the user presses
                                    //    two mouse buttons at the same time.)
             prevX = startX = evt.getX();  // Save mouse coordinates.
             prevY = startY = evt.getY();
             figure = figureChoice.getSelectedIndex();
             dragColor = getCurrentColor();        
             dragGraphics = OSI.getGraphics();
             dragGraphics.setColor(dragColor);
             dragging = true;  // Start drawing.
          } // end mousePressed()
          public void mouseReleased(MouseEvent evt) {
                  // Called whenever the user releases the mouse button.
                  // If the user was drawing a shape, we make the shape
                  // permanent by drawing it to the off-screen image.
              if (dragging == false)
                 return;  // Nothing to do because the user isn't drawing.
              dragging = false;
              mouseX = evt.getX();
              mouseY = evt.getY();
              if (figure == CURVE) {
                     // A CURVE is drawn as a series of LINEs
                  drawFigure(dragGraphics,LINE,prevX,prevY,mouseX,mouseY);
                  repaintRect(prevX,prevY,mouseX,mouseY);
              else if (figure == LINE) {
                 repaintRect(startX,startY,prevX,prevY);
                 if (mouseX != startX || mouseY != startY) {
                       // Draw the line only if it has non-zero length.
                    drawFigure(dragGraphics,figure,startX,startY,mouseX,mouseY);
                    repaintRect(startX,startY,mouseX,mouseY);
              else {
                 repaintRect(startX,startY,prevX,prevY);
                 if (mouseX != startX && mouseY != startY) {
                       // Draw the shape only if both its height
                       // and width are both non-zero.
                    drawFigure(dragGraphics,figure,startX,startY,mouseX,mouseY);
                    repaintRect(startX,startY,mouseX,mouseY);
              dragGraphics.dispose();
              dragGraphics = null;
          public void mouseDragged(MouseEvent evt) {
                   // Called whenever the user moves the mouse while a mouse button
                   // is down.  If the user is drawing a curve, draw a segment of
                   // the curve on the off-screen image, and repaint the part
                   // of the panel that contains the new line segment.  Otherwise,
                   // just call repaint and let paintComponent() draw the shape on
                   // top of the picture in the off-screen image.
              if (dragging == false)
                 return;  // Nothing to do because the user isn't drawing.
              mouseX = evt.getX();   // x-coordinate of mouse.
              mouseY = evt.getY();   // y=coordinate of mouse.
              if (figure == CURVE) {
                     // A CURVE is drawn as a series of LINEs.
                 drawFigure(dragGraphics,LINE,prevX,prevY,mouseX,mouseY);
                 repaintRect(prevX,prevY,mouseX,mouseY);
              else {
                    // Repaint two rectangles:  The one that contains the previous
                    // version of the figure, and the one that will contain the
                    // new version.  The first repaint is necessary to restore
                    // the picture from the off-screen image in that rectangle.
                 repaintRect(startX,startY,prevX,prevY);
                 repaintRect(startX,startY,mouseX,mouseY);
              prevX = mouseX;  // Save coords for the next call to mouseDragged or mouseReleased.
              prevY = mouseY;
          } // end mouseDragged.
          public void mouseEntered(MouseEvent evt) { }   // Some empty routines.
          public void mouseExited(MouseEvent evt) { }    //    (Required by the MouseListener
          public void mouseClicked(MouseEvent evt) { }   //    and MouseMotionListener
          public void mouseMoved(MouseEvent evt) { }     //    interfaces).
       } // end nested class Display

  • Console redirection not working when ILOM is launched from Ops Center.

    Hi,
    I just installed Ops Center and added a few servers as assets. I'm having trouble to get console redirection when I start LOM Manager from within Ops Center.
    If I point my browser and login directly to a server's ILOM web interface, I get console redirection without problems. If I do it through the "Start LOM Manager" option in Ops Center, I get an error message: "Cannot launch Java application" when I try to start redirection.
    Is this normal behavior?
    Thank you for your help.

    Do you mean the 'Launch LOM console" from Action pane? If so, check your java version on the PC/laptop you are accessing OC from.
    What is your OC version?
    I am not finding any issue in accessing the ILOM console.

Maybe you are looking for