InternalFrame content pane rendering

Hello everyone,
I am trying to create my own look and feel. I have extended the BasicLookAndFeel class. For most of the objects I can spot the properties I want to change, except for the InternalFrame. I have extended the BasicInternalFrameUI, but I can't figure out where to replace the component that is used for the content pane with one that has a different rendering. Or even change the existing component used as the content pane. Can someone point me out in the right direction?
Thanks,
7

I have overridden the UI class method createUI and still no luck.
Here is what I have:
public class myInternalFrameUI extends BasicInternalFrameUI
     public myInternalFrameUI(JInternalFrame frame)
          super(frame);
          System.err.println(frame.getContentPane().getClass().getName());
    public static ComponentUI createUI(JComponent b)   
        return new myInternalFrameUI((JInternalFrame)b);
}

Similar Messages

  • Resetting JApplet Content Pane

    I have an applet which needs to wait on another applet in the page being loaded before the GUI components can be rendered on the screen. My plugin appears to load the applets in the order that the HTML tags appear on the page, which is exactly the wrong order. Therefore, I spawned off a task to check for the other applet and load the component when it is present. According to debug output, all goes well. No exceptions are thrown and no debug output indicates any exceptions or error conditions being triggered. Instead, output indicates the GUI getting built and the content pane getting set to the new Container. Unfortunately, this new content pane never displays. Instead, the applet becomes a never-repainted box. What about JApplet and painting am I missing?

    You need to do your modifications to Swing components on the AWT thread after the components have be realized, i.e.
                java.awt.EventQueue.invokeLater(new Runnable() {
                    public void run() {
                            ////  make your changes to Swing components here
                });

  • Content Pane: Help getting rid of "Click to activate this control"

    I know this came up a long time ago when IE
    changed--Flash/swf content needs to be clicked to be activated
    first. I thought Robohelp 6 would address it, but not.
    The challenge: Cannot use the fixes publised because the html
    pages created by Robohelp, like the Content pane, are generated
    with Javascript. Ironically posted solutions use Javascript to
    change the Embed, object, etc. tags! And I don't know Javascript!
    The entire Content pane needs to be clicked first so you can
    click an item in the contents. Its html file seems to be
    wf_master.htm and when you look at the code, the tags are fed in
    like this:
    // Build tag to document.write
    strObject = "<OBJECT
    classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'";
    strObject += "WIDTH='100%' HEIGHT='100%' id='masterSWF'
    ALIGN='' VIEWASTEXT>";
    strObject += "<PARAM NAME='movie'
    VALUE='wf_master.swf'>";
    strObject += "<PARAM NAME=quality VALUE=high>";
    strObject += "<PARAM NAME='menu' value='false'>";
    // FlashVars for Object tag:
    strObject += "<PARAM NAME=FlashVars VALUE='" +
    strFlashVars + "'>";
    strObject += "<EMBED src='wf_master.swf' quality=high
    WIDTH='100%' menu='false' HEIGHT='100%' NAME='masterSWF'
    swliveconnect=true ALIGN='' ";
    // FlashVars for Embed tag:
    strObject += "FlashVars='" + strFlashVars + "' ";
    strObject += "TYPE='application/x-shockwave-flash'
    PLUGINSPAGE='
    http://www.macromedia.com/go/getflashplayer'>";
    strObject += "</EMBED>";
    strObject += "</OBJECT>";
    Adobe's solutions 1 or 2
    http://www.adobe.com/devnet/activecontent/
    assume you have regular html files.
    *Question/request:
    1) Has/can someone come up with a way or code (or function?)
    that can be added somewhere centrally (in a key file) so when
    robohelp renders the above html tags are replaced therefore
    eliminating the need of clicking the swf content to activate it?
    I don't know how Robohelp renders to help me find the file
    where a change like this can be made.
    2) Or can the output Javascript file be modified?
    Robohelp seems to ride on Javascript and the 'solutions' are
    in Javascript. I can't believe RObohelp developers have not
    addressed this with the Robohelp 6.
    I upgraded to Robohelp 6, use Robohelp HTML, publish using
    FlashHelp, and my users use IE,

    just search forum - this has been discussed almost everyday
    since the issue surfaced a few
    weeks/months ago - in fact somebody actually posted a link to
    an article explaining it 11 minutes
    before you posted your question
    Subject: IE Changes Due: What you can Expect.
    It's not a flash issue - it is an Eolas/Microsoft issue. Also
    google around - tons of articles on
    news sites about this and also on adobe and macromedia that
    explains it all.
    --> Adobe Certified Expert (ACE)
    --> www.mudbubble.com :: www.keyframer.com
    -->
    http://flashmx2004.com/forums/index.php?
    -->
    http://www.macromedia.com/devnet/flash/articles/animation_guide.html
    -->
    http://groups.google.com/advanced_group_search?q=group:*flash*&hl=en&lr=&ie=UTF-8&oe=UTF-8
    jrschaef wrote:
    > Why do I have to click twice to use a flash nav? When I
    first hover over the
    > nav there is a "Click to activate and use this control"
    pop up, I click it and
    > then I can use that nav but if I go to a new page it
    starts over again. I seen
    > another posting that refer to the same issue but didn't
    have a solution. Can
    > anyone help?
    >

  • How to add a text area in a Content pane..?

    Hi,
    I created a content pane with 5 buttons. One of them is a quit button, and I was able to create an "system.exit(0)" event handling for him. My problem is.. I have 4 other buttons, and I want them to show some text when I click them. How do I add a text area bellow my content pane..?
    Copy/paste my code to see what im talking about :) :
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Interface extends JFrame {
    public Interface() {
    Container contentPane = getContentPane();
    contentPane.setLayout(new FlowLayout());
    JButton button1 = new JButton("Test1");
    JButton button2 = new JButton("Test2");
    JButton button3 = new JButton("Test3");
    JButton button4 = new JButton("Test4");
    JButton button5 = new JButton("Quit");
    ButtonHandler handler = new ButtonHandler();
    button5.addActionListener( handler );
    contentPane.add(button1);
    contentPane.add(button2);
    contentPane.add(button3);
    contentPane.add(button4);
    contentPane.add(button5);
    contentPane.setBackground(Color.orange);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public static void main(String args[]) {
    Interface window = new Interface();
    window.setLocation(250,350);
    window.setTitle("FlowLayout");
    window.pack();
    window.setTitle("Test");
    window.setVisible(true);
    public class ButtonHandler implements ActionListener {
    public void actionPerformed( ActionEvent e )
    System.exit(0);
    Thanks alot! :)

    By default the content pane of the JFrame uses a Border Layout. So you should:
    1) Create a JPanel
    2) Set the layout of the JPanel to FlowLayout
    3) add the buttons to the panel
    4) add the panel to the content pane
    5) add your text area to the content pane
    Read this section from the Swing tutorial on "Using Layout Managers":
    http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html

  • TIFF thumbnails do not enlarge in either preview pane or content pane?

    I have CS6 Bridge and Photoshop on a new 2014 iMac.
    The thumbnail size as viewed on screen is a limited size (around 2cm x 1cm).  Enlarging the preview pane just increases the space around the thumbnail rather than the thumbnail increasing to fill the pane.  Similarly, in the folder contents panel, if I use the slider bottom right in Bridge this only inreases the size of the space around the thumbnail.  It is almost as if I have the max cache set at something really small.  But, I don't, it's set at 1000MB.
    This phenomenon applies, oddly, only to tiff files.  If I use Bridge CS6 to view jpeg or raw files from multiple cameras (.dng,.cr2) it works perfectly.  So, only tiffs is the problem. 
    Any similar problems, resolutions, greatly appreciated.  For the moment I have to use Bridge CS4 with PS CS6 as my workround.
    Thanks.

    All of a sudden my Bridge Content panel does not show any info on thumbnail
    photos, neither file number nor any metadata preferences.  Info is OK in the
    Metadata window, but not on Content pane
    Also, the file folder thumbnail icons in Content panel now have the file
    numbers super-imposed over the file instead of below.
    That is caused by accidently hit cmd+T and that command does hide the
    thumbnail info and put the name of the folder over the icon.
    Hit cmd + T again to solve this or go the menu view and deselect the Show
    thumbnail only command
    Coincidentally the font size of my Metadata panel suddenly got bigger and
    bolder, not the Keyword panel or any other, just Metadata.  Doesn't really
    bother me, but seems odd these have all just happened
    That I have not seen before but might be solved with resetting the prefs as
    Tai Lao described in his post.

  • Topic Content Pane ( div ) overlaps SideBar (TOC/Index) Pane after publishing Browser-based AirHelp, while locally it works fine.

    Hi,
    I have been facing this issue where the Topic Content Pane (<div>) overlaps the SideBar pane every time I try to open the Browser-Based AirHelp after it has been published on a server.
    Although, if I view the same locally on my machine, it appears fine.
    I'm using RoboHelp 10 to create the help and have the context sensitivity enabled for integrating the help with my software application.
    I have also created the custom window for viewing help.
    Now, considering the fact, that we are only using and testing our helpfile on the latest versions of Firefox and Chrome browsers with Flash enabled, this problem however, is not consistent. After getting published, on some machines it appears fine on both browsers and on some it only appears fine on any one of the browsers. Also, there are some machines, where the problem is seen on both browsers.
    For Example:
    When I try to view the helpfile after it has been published on a server, the following issues are observed:
    On My Machine: Topic Content pane overlaps Sidebar pane on Chrome browser and on Firefox it appears fine.
    Firefox version: 35.0.1, Chrome Version: 40.0.2214.115 m, Adobe Flash Player 11 Plugin Version: 11.7.700.202
    On Another Machine: It appears fine on both browsers.
    Firefox version: 35.0.1, Chrome Version: 40.0.2214.115 m, Adobe Flash Player 11 Plugin Version:11.6.6.2.171
    Now take a look at these images:
    (On Chrome) When Opened Locally:
    (On Firefox) After Getting Published:
    (On Chrome) After Getting Published:
    Machine 1: Topic content overlaps TOC pane
    Machine 2:  Empty white space appears at the bottom (below footer)
    After going through all the relevant information that could be found on your AirHelp forums, I couldn't find a solution.
    This issue is very critical to me right now due to the upcoming documentation releases, and i need a resolution to this ASAP. Please Help.

    Hi Jeff,
    I wrongly addressed it to Adobe. Any help through this forum would be appreciated.

  • Content pane doubt

    What exactly is the content pane and what is its purpose? I read this but am still quite confused. By the mini flow chart thing, do they mean that first i create a JFrame and then i get the contentPane for it and then i can add components like JPanel and JButton to the contentPane?
    Or can i skip the getContentPane part and directly start adding stuff like JPanel and JButtons to the JFrame? if this is true, is it preferable to do this? are there any advantages or disadvantages to doing this instead of adding components to the contentpane?
    Please help me understand this concept. Thank You.

    it's pane that contains the contents of the frame (or the rootpane, more specifically).
    You create the JFrame first.
    Then you add stuff to it's content pane. Since Java 5, you can add directly to the JFrame, and it puts things you add into the content pane for you. But it's the same thing.
    Or you can add things to your own panel, then set the panel as the content pane of the frame.
    You can't really add things to the JFrame directly without messing things up (and actually the API won't let you), cuz the rootpane is used for other things like menubars and the glasspane.

  • Content not rendering when renderMode is set to CPU on QM734-8G

    I developed a mobile app for Android and iOS.
    Recently, I've come across an android tablet, QM734-8G, that uses Android 4.2.2. When launching the app on this device, I simply get a blank screen and no content is rendered. I know the app is running because when I debug it, I can see all the code executed and traces appearing in the console.
    After a lot of testing, I narrowed down the issue; it has to do with the renderMode. The app uses CPU render mode because I don't use any Stage 3D stuff or perform any graphic intensive operations. When I set the render mode to GPU the content does get renreded but I lose the filters (which is a known limitation of GPU rendering) and scrollRect doesn't work as expected. When I set the render mode to DIRECT I can also see the content and this time with filters and everything but the app starts crashing as it seems the memory usage increases in that render mode.
    I've done a quick test and created and empty text projetc in Flash Builder and I simply specify the background of the SWF and with that simple test I can replicate the issue, so it's not sometihng specific to the content in my app. I've tested using AIR 3.8 and AIR 3.9.
    The tablet has low specs and it's really cheap, but from what I see, the specs are enough to support app deployed usign AIR. Is there something I'm missing?
    Please see a screenshot of the device info page.

    This means that the SWF is written so that it only works when
    embedded in a web page. When you add the SWF to the stage as a
    stand-alone display object using addChild() it is not being hosted
    in the web page.
    You have 2 options:
    1. Modify the SWF code (if possible) to remove the
    ExternalInterface requirement. You can write code in your AIR
    application javascript to subscribe directly to events from the SWF
    using addListener() and call functions directly on the SWF object
    (Flash/Actionscript is not my primary development environment... so
    if I have gotten the terminology wrong I apologize, but I HAVE
    written a flash application that worked as I describe). My SWF
    actually works embedded in HTML or not using the code "if
    (ExternalInterface.available) {
    ExternalInterface.addCallback("setIsPlaying", setIsPlaying ); }"
    2) Somehow add a HTMLLoader in a new child window (with
    transparent = false) to the stage as a new child. I have not yet
    figured out exactly how to do this, so If anyone can provide
    information on how to do this, I too would be appreciative.

  • Problem with content pane

    hi,
    if I have to add three different toolbars in same content pane.
    If I add these, each one of them gets overwrite over another. and only last one toolbar gets visible. please help. Also, I need the toolbar to keep top most when i dock them.

    shamail says - "I guess you didnt read the message carefully"
    late4ever says = "u can't add more than 1 toolbar on top"
    Did either of you bother to take the time to read the tutorial on "Using Layout Managers". A JToolBar is simply a component. Multiple components can be added to a container. By default the content pane uses a BorderLayout which only accepts 5 components (Center, North, South, East, West) which is why when you keep adding components to the same area you can only see the last one.
    When you create a JPanel, by default it uses a FlowLayout. When you add components they get added to the right of the previous component, which was why I gave you the sample code.
    I thought my previous answer was straight forward so I only included a piece of code. Here is a complete program you can run:
    import javax.swing.*;
    public class MultipleToolBars extends JFrame
         public MultipleToolBars(String strName)
              this.setTitle(strName);
              JPanel jp1 = new JPanel();
              JToolBar jtb1 = new JToolBar("tool1");
              JToolBar jtb2 = new JToolBar("tool2");
              JToolBar jtb3 = new JToolBar("tool3");
              JButton jb1 = new JButton("JB1");
              JButton jb2 = new JButton("JB2");
              JButton jb3 = new JButton("JB3");
              JButton jb4 = new JButton("TOOL1");
              JButton jb5 = new JButton("TOOL2");
              JButton jb6 = new JButton("TOOL3");
              JButton jb7 = new JButton("BUTTON1");
              JButton jb8 = new JButton("BUTTON1");
              JButton jb9 = new JButton("BUTTON2");
              jtb1.setFloatable(true);
              jtb2.setFloatable(true);
              jtb3.setFloatable(true);
              jtb1.add(jb1);
              jtb1.add(jb2);
              jtb1.add(jb3);
              jtb2.add(jb4);
              jtb2.add(jb5);
              jtb2.add(jb6);
              jtb3.add(jb7);
              jtb3.add(jb8);
              jtb3.add(jb9);
              jp1.add(jtb1);
              jp1.add(jtb2);
              jp1.add(jtb3);
              getContentPane().add(jp1);
         public static void main(String[] args)
              MultipleToolBars mtb = new MultipleToolBars("test");
              mtb.setSize(600, 75);
              mtb.setVisible( true );

  • Should a Status Bar be in the Root Pane or Content Pane?

    Hello, I wonder if you can help...
    Should a status bar be built into a JFrame (much like a JMenuBar, by extending JFrame and JRootPane along with its layout manager)?
    I have created a status bar using the method above, but it seems to be more complex than it need be; so I am wondering whether to simply add it to a JFrames content pane.
    Advantages of extending JRootPane and building the status bar as part of a frame:
    1. It allows the frames content panes south region to remain unoccupied, and thus will not conflict with a JToolPanes positioning.
    Advantages of adding the status bar to the content pane south region:
    1. Keeps the design nice and simple, so no knowledge of the root pane need be known;
    2. We can use composition (rather that inheritance) to define the frame and its parts.
    All comments are welcome.

    Hi,
    ( I search for iChat questions when I have finished in the iChat Forum)
    So the menu bar reads iChat, File,  Edit,  View, Buddies, Video, Window and Help
    There is no Buddy List open.
    There is no other window for iChat open.
    In the iChat Menu you only have access to Status.
    Is an item ticked in the list ?
    Is this a green (Available item) or  Red ( an Away one) ?
    Can you access the Accounts option ?  (Sitll in the iChat Menu)
    Is anything in here ticked ?
    In the Window menu any Logged in account should appear in the list  (Between the Next Chat and File Transfer items)
    It would be useful to know which version of iChat this is.
    If no account is ticked (iChat Menu > Accounts) or not showing in the Window Menu, plus you cannot determine the Status and you cannot access the Preferences then you need to access your Home Folder/Library/Preferences
    As the Library in the Home Holder is Invisible in Lion you will need the Finder's Go Menu > Go to Folder option  (you can use it in earlier OS versions if you want)
    Type in:-
    ~/Library/Preferences
    Find the file called com.apple.ichat.plist
    Drag it to the Trash and Restart iChat.
    This will lose all the settings in iChat that you have changed from Defaults but there is no way around this.
    9:23 PM      Saturday; August 27, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Content pane painting over JPopupMenu

    I have a rather complex series of overridden components (JMenuBar, JPanels, JMenus, JFrame, etc.) that I aggregate to form a 'theme frame' --- basically a 'lightweight' L&F decorated frame. The main frame is an UNDECORATED JFrame derivation, in which I basically install a derived JMenuBar class that looks and acts like the top portion of the frame's 'border' (i.e. the title bar), as well as accomodating the menu items for the frame. I then launch several of these frames from the main application, each with its own set of menus (a single top-level JMenu with a few menu items on the popup).
    My problem is this... if there are more than 1 of these frames extant after the initial start-up of the application, I can invoke the top-level menu on all of the frames, but only 1 of them actually paints it correctly... the others will show the JPopupMenu, but then the embedded content repaints AFTERWARDS, thus painting over all but the first item on the menu. What's really very bazaar is that it seems to depend totally on location of the frame on the screen (i.e. in relation to the other frames). Initially, only the top-most and/or left-most frame will paint the JPopupMenu correctly, and the rest will exhibit this "show the popup, then paint the content pane over it" behavior.
    With the help of print statements, I've been able to determine that the frame which paints the popup correctly DOES NOT get a repaint() notification on it's content-pane, whereas the others do (hence the 'cover-up' behavior of those).
    It may be useful to note that the 'content' of these frames are actually applets, which themselves have a complex set of specialized components embedded in them.
    None of the menu objects or other components involved are static to the frame class, so nothing's being shared... also, if I move one of the non-functioning windows to a different location on the screen, then the menu works fine... move it back, and the menu gets painted over again.
    I'm using JDK 1.4, JBuilder X, all components are Swing.
    Any help, please??????
    XNHillBilly

    That did the trick! I had a gut feeling it was something simple like that... I still don't fully understand exactly what was going on (why one frame would paint fine, while the others wouldn't), but that's less important than having it work correctly at this point ;-)
    Thanks mucho rykk,
    XNHillBilly

  • Content Pane Problem

    Greetings!
    I'm facing two related problems in developing a Java Applet.
    My applet class extends JApplet.
    1) The current default layout of the whole window (not individual
    components) seems to be a flowLayout. I'd like to set the layout to a
    gridBagLayout, however the setLayout command does not seem to be
    understood (my compiler is eclipse, JRE 1.5.0 and JDK 5.0), so I
    cannot get the following code to work, no specific error msg
    generated:
    getContentPane.setLayout(new GridBagLayout);
    2) similar problem, cannot setBackground or setForeground of the
    overall pane.
    Please Advise, thanks.
    -Darum

    The essentials of the code in question:
    public class STMapplet extends JApplet implements ActionListener{
         getContentPane.setLayout(new GridBagLayout());
    The whole code:
    public class STMapplet extends JApplet implements ActionListener{
         //Creat Public Text Area with 10 rows, 5 columns
         JTextArea text = new JTextArea(10,20);
         //Set the contentPane (overall applett) layout
         getContentPane.setLayout(new GridBagLayout());
         //Generate image public object and set location
         Image picture;
         int imageX = 175;
         int imageY = 50;
         //frame specs, # of frames, time between frames (ms)
         int NUM_FRMS = 65;
         int MAX_FRMS = 65;
         long FRMRATE = 7;
         //Declare variables
         boolean highV = false;
         boolean lowV = false;
         boolean highI = false;
         boolean lowI = false;
         // Declare Public image URLS, will be established later during paint method
         // Use the same URLs for LILV and HIHV
         URL hVhI;
         URL hVlI;
         URL lVhI;
         //Border URLs
         URL IMGBorderTop;
         URL IMGBorderLeft;
         URL IMGBorderRight;
         URL IMGBorderBottom;
         Image BORDERTOP;
         Image BORDERLEFT;
         Image BORDERRIGHT;
         Image BORDERBOTTOM;
         //Declare Public Buttons
         JButton highVButton;
         JButton lowVButton;
         JButton highIButton;
         JButton lowIButton;
         JButton SCAN;
         * constraint construction for layout
         * addGB adds a component to the panel that has a grid bag layout
         GridBagConstraints constraints = new GridBagConstraints();
         void addGB(JPanel panel, Component component, int x, int y){
              constraints.gridx =x;
              constraints.gridy = y;
              panel.add(component, constraints);     
         * Build User Interface
         public void init()
              //Generate buttons for each of the conditions
              SCAN = new JButton("Begin Scanning");
              highVButton = new JButton("1.00");
              lowVButton = new JButton("0.07");
              highIButton = new JButton("2.00");
              lowIButton = new JButton("0.10");
              //add action detection, the action listener is this
              SCAN.addActionListener( this );
              highVButton.addActionListener( this );
              lowVButton.addActionListener( this );
              highIButton.addActionListener( this );
              lowIButton.addActionListener( this );
              //create viewing panel with gridbag layout
              JPanel panel = new JPanel(new GridBagLayout());
              //create pane for text and add to content pane
              getContentPane().add( "East", new JScrollPane (text));
              //add buttons and headers to panel and add panel to pane
              addGB(panel, new JLabel("Voltage (V)"),0,1);
              addGB(panel, new JLabel("Current (nA)"),0,4);
              addGB(panel, highVButton,0,3);
              addGB(panel, lowVButton, 0,2);
              addGB(panel, highIButton, 0,6);
              addGB(panel, lowIButton,0,5);
              addGB(panel, SCAN, 0, 0);
              getContentPane().add("West" , panel);
              //author
              text.append("@Darin Bellisario\n");
         * Display image according to buttons pressed, called with repaint()
         public void paint(Graphics g){
              //Draw Border
              //Get URLs
              try { IMGBorderTop = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderTop.jpg");} catch (Exception e){}
              try { IMGBorderRight = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderRight.jpg");} catch (Exception e){}
              try { IMGBorderLeft = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderLeft.jpg");} catch (Exception e){}
              try { IMGBorderBottom = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderBottom.jpg");} catch (Exception e){}
              // Draw
              BORDERTOP = getImage(IMGBorderTop, "IMGBorderTop.jpg");
              BORDERRIGHT = getImage(IMGBorderRight, "IMGBorderRight.jpg");
              BORDERLEFT = getImage(IMGBorderLeft, "IMGBorderleft.jpg");
              BORDERBOTTOM = getImage(IMGBorderBottom, "IMGBorderBottom.jpg");
              g.drawImage(BORDERTOP,imageX - 49, imageY - 20, this );
              g.drawImage(BORDERRIGHT,imageX + 613, imageY, this );
              g.drawImage(BORDERLEFT,imageX - 49, imageY, this );
              g.drawImage(BORDERBOTTOM,imageX, imageY + 613, this );
              //     Display Appropriate image (HIHV & LILV same image)
              if( (highV == true && highI == true) || (lowV == true && lowI == true) ){
                   for (int i = 1; i<= NUM_FRMS; i++){
                             //Display first part of pic
                             try { hVhI = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/LILV&HIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             picture = getImage(hVhI, "LILV&HIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             g.drawImage(picture,imageX,imageY,this);
                             //wait
                             Thread.sleep(FRMRATE);
                             }catch (Exception e){System.out.println("the wait thing fucked up");}
              } else      if( (highV == true && lowI == true) ){
                   for (int i = 1; i<= NUM_FRMS; i++){
                             //Display first part of pic
                             try { hVlI = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/LIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             picture = getImage(hVhI, "LIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             g.drawImage(picture,imageX,imageY,this);
                             //wait
                             Thread.sleep(FRMRATE);
                             }catch (Exception e){System.out.println("the wait thing fucked up");}
              } else      if( (lowV == true && highI == true) ){
                   for (int i = 1; i<= NUM_FRMS; i++){
                             //Display first part of pic
                             try { lVhI = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/HILV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             picture = getImage(hVhI, "HILV" + i + "of" + NUM_FRMS + "%20copy.jpg");
                             g.drawImage(picture,imageX,imageY,this);
                             //wait
                             Thread.sleep(FRMRATE);
                             }catch (Exception e){System.out.println("the wait thing fucked up");}
         //change image based on what buttons pressed. When an action is performed, the actionlistener (this) calls actionperformed
         public void actionPerformed (ActionEvent e){
              if (e.getSource() == highVButton){
                   highV = true;
                   lowV = false;
                   text.append("Voltage on High\n");
              if (e.getSource() == lowVButton){
                   lowV = true;
                   highV = false;
                   text.append("Voltage on Low\n");
              if (e.getSource() == highIButton){
                   lowI = false;
                   highI = true;
                   text.append("Current on High\n");
              if (e.getSource() == lowIButton){
                   lowI = true;
                   highI = false;
                   text.append("Current on Low\n");
              if (e.getSource() == SCAN){
                   text.append("Scanning\n");
                   repaint();
    Many Thanks for Any Aid!
    -Darum

  • Fitting JPanel perfectly inside content pane of JFrame

    Say I have a JPanel with size W x H that I want to add to a JFrame such that the JFrame will be sized as small as possible while still fitting the panel inside its content pane. Is there a method in JPanel that I can overwrite or a specific method of adding to a JFrame that I can use to accomplish this, or do I need to calculate the JFrame's size with getInsets()?
    Thanks.

    If I do this...
    JFrame frame = new JFrame("Pack Test");
    JPanel panel = new JPanel();
    panel.setSize(300, 300);
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);...the resulting content pane is most definitely not 300x300 pixels. What am I doing wrong?

  • How to make content Pane on JFrame looks like Moving

    Hi guys,I have to make a Content Pane look like Race Track which is constantly moving as the cars moves forward.

    Yeah, you might want to check out SwingWorker
    http://java.sun.com/products/jfc/tsc/articles/threads/update.html
    .. and put the cars in threads.

  • Adding new content pane on another

    Hi,
    I am trying to add a new contnet pane JPanel on the existing one and it shows the new one with some buttons but the previous JPanel dissappears.
    frame.setContentPane(checkBox1);
    frame.setContentPane(buttons2);
    So it shows the buttons2 pane but not the checkBox1.
    Any idea what am i missing?
    Thank you

    The setContentPane just replaces the pane, not add them.
    Add the two panes you want to see to a third pane and make the new pane the content pane
      JPanel contentPanel = new JPanel();
      contentPanel.add(checkBox1);
      contentPanel.add(buttons2);
      frame.setContentPane(contentPanel);

Maybe you are looking for

  • Data not getting displayed in SNI monitor Web-UI screen

    Dear all, We are running the program ROEMPROACT2 in ECC to transfer planned independent requriement entered in MD61, the message ProductActivityNotification_In is successful in ECC and SNC. SLG1 shows warning message "Item 1: ShipFromLocation and Ven

  • Itunes in my Mac does not see my Iphone. It is seen only as camera

    I just bought this Iphone and by mistake I checked "Yes" to a question if I wanted to turn on the automatic updates. After several minutes the Iphone was visible by Itunes in my Mac it disappeared and do not know where to disable such functions to re

  • Require output file name same as input file without extension

    I am doing a POC where I require that my output file name should be same as input file name. The input is a XML and output is Flatfile. If I use %SourceFileName%, i am getting the output with extension. How can I remove the extension? Do I need to wr

  • Is anyone else having problems with facebook page?

    i have graphic issues on Facebook, its slow, it logs out by itself... wish i could upload a picture to show all the details!! how can i upload a picture here?

  • Is There any Relation Between PCD and SSO

    Hi,   Is there any relation between PCD and SSO, why because if i am try to connect from portal to R/3 in the user mapping i got one error i.e some pcd error. pls tell me how to rectify that. Regards, Jagadish Babu Kanikanti.