Unexpected Behaviors of Mouse Event in Look And Feel

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Test{
     public static void main(String[] args){
          try {
              // Set System L&F
             UIManager.setLookAndFeel(
                 UIManager.getSystemLookAndFeelClassName());
         catch (UnsupportedLookAndFeelException e) {
            // handle exception
         catch (ClassNotFoundException e) {
            // handle exception
         catch (InstantiationException e) {
            // handle exception
         catch (IllegalAccessException e) {
            // handle exception
          JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(400,400);
          final JPopupMenu popup = new JPopupMenu();
          popup.add(new JMenuItem("Test"));
          JPanel panel = new JPanel();
          panel.addMouseListener(new MouseAdapter(){
               public void mousePressed(MouseEvent e){
                    System.out.println("Mouse Pressed!");
                    if(e.isPopupTrigger())
                         popup.show(e.getComponent(), e.getX(), e.getY());
               public void mouseReleased(MouseEvent e){
                    System.out.println("Mouse Released!");
                    if(e.isPopupTrigger())
                         popup.show(e.getComponent(), e.getX(), e.getY());
          frame.add(panel);
          frame.setVisible(true);
}When I right click, the popup menu shows up and prints:
Mouse Pressed!
Mouse Released!
Then I click on another position, it will print:
Mouse Pressed!
Mouse Released!
The problem is when I set the LookAndFeel to SystemLookAndFeel (which is Windows XP), it only prints:
Mouse Released!
after the pop up menu shows up.
I wonder what happened to the Mouse Pressed Event?

Late to the party, but I'd like to add that I came across this same problem when we recently upgraded from 1.6_02 to 1.6_11. I have a JTable where a right-click produces a JPopupMenu, but a double right-click is a shortcut to one of the popup menu functions. Popup shows up fine on the single-click in both, but the double-click function didn't work in the later version.
As hinted in this thread, it happens when you are reacting to the mousePressed event and you've install the System L&F (at least on Windows XP). I printed out PopupMenu.consumeEventOnClose after setting the L&F, and it reported true. So all I did was override that property to false after setting the L&F, and everything was back to normal.
Not sure why that changed between those two updates. There were bug fixes 6539458 in u4 and 6217905 in u10 that are both related to JPopupMenu, so maybe one of those accounts for the difference. Hopefully I'm not breaking something by overriding the property.

Similar Messages

  • Extending JComboBox  behavior and changing look and feel

    In order to change JComboBox behavior, usually we will extend the MetalComboBoxUI or WindowsComboBoxUI (for example: for controlling the popup width)
    The problem arise when we want to be able to change the pluggable look and feel: all components got the new look and feel except for the comboboxes.
    A dirty solution can be extending our ComboBoxUI from the new look and feel library but in the case of jgoodies it is even impossible because PlasticComboBoxUI is final
    Any ideas?

    In order to change JComboBox behavior, usually we will extend the MetalComboBoxUI or WindowsComboBoxUI (for example: for controlling the popup width).
    The problem arise when we want to be able to change the pluggable look and feel: all components got the
    new look and feel except for the comboboxes. A dirty solution can be extending our ComboBoxUI from
    the new look and feel library but in the case of jgoodies it is even impossible because PlasticComboBoxUI is final
    My best suggestion: request the L&F provider to make his combo box homogeneous with the other components.

  • Event on changing Look and Feel

    I want to know what event is fired when I change Look and Feel.
    Thanks,
    Pati

    Ideally you'll be using the UIManager.setLookAndFeel() to change the installed LookAndFeel. In the UIManager, the installed LNF is bound to a JavaBeans property using the SwingPropertyChangeSupport with the key: "lookandfeel". Any time this changes, a PropertyChangeEvent will be fired to the PropertyChangeListeners registered with the UIManager. You can simply add a PropertyChangeListener to the UIManager and listen for events that are bound to that particular property, such as...
        UIManager.addPropertyChangeListener( new PropertyChangeListener() {
            public void propertyChange( PropertyChangeEvent e ) {
                if( "lookAndFeel".equals( e.getPropertyName() ) ) {
                    System.out.println( "look and feel changed" );
        });The event encapsulates the new value and the old value so you can do whatever you need with that information.
    I used an anonymous inner class mostly as an example - You may need to consider a cleaner design for your purposes.
    Hope this helps!
    Matt

  • HTMLB or html - when we need full control of look and feel and events

    Hi Experts,
          In my requirement i  need to change the look and feel of the BSP UI as per customer standards and i need to have most of my processing on client side, Please advise me whether to go for HTMLB or normal HTML. mainly i fount most of the client side events are not available in HTMLB....
    Thanks in advance
    Karthik

    Hi Karthik,
    The look and feel of the BSP Tags can be applied via Portal. If you are seeing your BSP application through a protal system, then you can develop a theme inside the portal and apply it to your BSP application. The portal theme will be automatically supported by the HTMLB tags. For more infomation on this you can search in the portal forum section, you will find a lot of post for this topic.
    But if you need a complex customization of the UI controls inside the BSP application, as suggested in the previous post you should go for HTML + Javascript library.
    Hope it is helpful!
    Regards,
    Maheswaran

  • Strange look and feel behavior

    Hi!
    I'm developing a little program using JDK 1.1.8. I'm using the Metal look and feel, and everything goes well. The componentes are showed perfectly. Because I need to distribute the program to other PCs, I have compressed the program into a Jar file. In the other PC I've installed the JRE 1.3 that has capability to double click on a jar file and run it. The problem is that when I run the program with the jar method, the size of the components changes (especially the tables, and the fonts), and I don�t understand why, because I have specified in the beginning of the program to use the Metal Look and feel.
    What can be the problem?
    Thanks a lot!

    There've been an awful lot of bug fixes and changes between 1.1.8 and 1.3 -- I'm not surprised there'd be some differences.
    I'd say install 1.3 on development machine and see how it looks -- probably looks different as well. If you want to know specifically why, then you're gonna have to read all the release notes for each update from 1.1.8 thru 1.3 and you'll probably find alot of reasons.

  • Problem With ButtonUI in an Auxiliary Look and Feel

    This is my first post to one of these forums, so I hope everything works correctly.
    I have been trying to get an axiliary look and feel installed to do some minor tweaking to the default UI. In particular, I need it to work with Windows and/or Metal as the default UI. For the most part I let the installed default look and feel handle things with my code making some colors lighter, darker, etc. I also play with focus issues by adding FocusListeners to some components. I expect my code to work reasonably well no matter what the default look and feel is. It works well with Motif, Metal, and Windows, the only default look and feels I've tested with. What I'm going to post is a stripped down version of what I have been working on. This example makes gross changes to the JButton background and foreground colors in order to illustrate what I've encountered.
    I have three source code files. The first, Problem.java, creates a JFrame and adds five buttons to it. One button installs MyAuxLookAndFeel as an auxiliary look and feel using MyAuxButtonUI for the look and feel of JButtons. The next button removes that look and feel. The next button does nothing except print a line to System.out. The next button installs MyAuxLookAndFeel as an auxiliary look and feel using MyModButtonUI for the look and feel of JButtons. The last button removes that look and feel.
    The problem is, when I install the first auxiliary look and feel, buttons are no longer tabable. Also, they cannot be invoked by pressing the space button when they're in focus. When I remove the first auxiliary look and feel everything reverts to behaving normally. When I add the "Mod" version, button tabability is fine. The only difference is I've added the following code:
    if ( c.isFocusable() ) {
       c.setFocusable(true);
    }That strikes me as an odd piece of code to profoundly change the program behavior. Anyway, after adding and removing the "Mod" look and feel, the tababilty is forever fixed. That is, if I subsequently re-install the first look and feel, tababilty works just fine.
    The problem with using the space bar to select a focused button is more problematic. My class is not supposed to mess with the default look and feel which may or may not use the space bar to press the button with focus. When the commented code in MyModButtonUI is uncommented, things behave correctly. Even the statement
    button.getInputMap().remove( spaceKeyStroke );doesn't mess things up after the auxiliary look and feel is removed. So far I've tested this with JRE 1.4.2_06 under Windows 2000, JRE 1.4.2_10 under Windows XP, and JRE 1.5.0_06 under Windows XP and the behavior is the same.
    All of this leads me to two questions.
    1. Is my approach fundamentally flawed? I've extended TextUI and ScrollBarUI with no problems. This is the only problem I've encountered with ButtonUI. My real workaround for the space bar issue is better than the one I've supplied in the example, but it certainly is not guaranteed to work for any arbitrary default look and feel.
    2. Assuming I have no fundamental problems with my approach, it's possible I've found a real bug. I searched the bug database and couldn't find anything like this. Of course, this is the first time I've tried seasrching the database for a bug so my I'm doing it badly. Has this already been reported as a bug? Is there any reason I shouldn't report it?
    What follows is the source code for my example. It's in three files because the two ButtonUI classes must be public in order to work. Thanks for insight you can provide.
    Bill
    File Problem.java:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Problem extends JFrame {
       public boolean isAuxInstalled = false;
       public boolean isModInstalled = false;
       public LookAndFeel lookAndFeel = new MyAuxLookAndFeel();
       private static int ctr = 0;
       public static void main( String[] args ) {
          new Problem();
       public Problem() {
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setSize(250, 150);
          setTitle("Button Test");
          JButton install = new JButton("Install");
          JButton remove = new JButton("Remove");
          JButton doNothing = new JButton("Do Nothing");
          JButton installMod = new JButton("Install Mod");
          JButton removeMod = new JButton("Remove Mod");
          this.getContentPane().setLayout(new FlowLayout());
          this.getContentPane().add(install);
          this.getContentPane().add(remove);
          this.getContentPane().add(doNothing);
          this.getContentPane().add(installMod);
          this.getContentPane().add(removeMod);
          install.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( !isAuxInstalled ) {
                   isAuxInstalled = true;
                   UIManager.addAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          remove.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( isAuxInstalled ) {
                   isAuxInstalled = false;
                   UIManager.removeAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          doNothing.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                System.out.println( "Do nothing " + (++ctr) );
          installMod.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( !isModInstalled ) {
                   isModInstalled = true;
                   UIManager.addAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          removeMod.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( isModInstalled ) {
                   isModInstalled = false;
                   UIManager.removeAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          setVisible(true);
       class MyAuxLookAndFeel extends LookAndFeel {
          public String getName() {
             return "Button Test";
          public String getID() {
             return "Not well known";
          public String getDescription() {
             return "Button Test Look and Feel";
          public boolean isSupportedLookAndFeel() {
             return true;
          public boolean isNativeLookAndFeel() {
             return false;
          public UIDefaults getDefaults() {
             UIDefaults table = new MyDefaults();
             Object[] uiDefaults = {
                "ButtonUI", (isModInstalled ? "MyModButtonUI" : "MyAuxButtonUI"),
             table.putDefaults(uiDefaults);
             return table;
       class MyDefaults extends UIDefaults {
          protected void getUIError(String msg) {
    //         System.err.println("(Not) An annoying error message!");
    }File MyAuxButtonUI.java:
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.plaf.*;
    import javax.swing.plaf.multi.*;
    import javax.accessibility.*;
    public class MyAuxButtonUI extends ButtonUI {
       private Color background;
       private Color foreground;
       private ButtonUI ui = null;
       public static ComponentUI createUI( JComponent c ) {
          return new MyAuxButtonUI();
       public void installUI(JComponent c) {
          MultiButtonUI multiButtonUI = (MultiButtonUI) UIManager.getUI(c);
          this.ui = (ButtonUI) (multiButtonUI.getUIs()[0]);
          super.installUI( c );
          background = c.getBackground();
          foreground = c.getForeground();
          c.setBackground(Color.GREEN);
          c.setForeground(Color.RED);
       public void uninstallUI(JComponent c) {
          super.uninstallUI( c );
          c.setBackground(background);
          c.setForeground(foreground);
          this.ui = null;
       public void paint(Graphics g, JComponent c) {
          this.ui.paint( g, c );
       public void update(Graphics g, JComponent c) {
          this.ui.update( g, c );
       public Dimension getPreferredSize(JComponent c) {
          if ( this.ui == null ) {
             return super.getPreferredSize( c );
          return this.ui.getPreferredSize( c );
       public Dimension getMinimumSize(JComponent c) {
          if ( this.ui == null ) {
             return super.getMinimumSize( c );
          return this.ui.getMinimumSize( c );
       public Dimension getMaximumSize(JComponent c) {
          if ( this.ui == null ) {
             return super.getMaximumSize( c );
          return this.ui.getMaximumSize( c );
       public boolean contains(JComponent c, int x, int y) {
          if ( this.ui == null ) {
             return super.contains( c, x, y );
          return this.ui.contains( c, x, y );
       public int getAccessibleChildrenCount(JComponent c) {
          if ( this.ui == null ) {
             return super.getAccessibleChildrenCount( c );
          return this.ui.getAccessibleChildrenCount( c );
       public Accessible getAccessibleChild(JComponent c, int ii) {
          if ( this.ui == null ) {
             return super.getAccessibleChild( c, ii );
          return this.ui.getAccessibleChild( c, ii );
    }File MyModButtonUI.java:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.plaf.*;
    public class MyModButtonUI extends MyAuxButtonUI
       static KeyStroke spaceKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0 );
       public static ComponentUI createUI( JComponent c ) {
          return new MyModButtonUI();
       public void installUI(JComponent c) {
          super.installUI(c);
          c.setBackground(Color.CYAN);
          if ( c.isFocusable() ) {
             c.setFocusable(true);
    //      final JButton button = (JButton) c;
    //      button.getInputMap().put( spaceKeyStroke, "buttonexample.pressed" );
    //      button.getActionMap().put( "buttonexample.pressed", new AbstractAction() {
    //         public void actionPerformed(ActionEvent e) {
    //            button.doClick();
    //   public void uninstallUI(JComponent c) {
    //      super.uninstallUI(c);
    //      JButton button = (JButton) c;
    //      button.getInputMap().remove( spaceKeyStroke );
    //      button.getActionMap().remove( "buttonexample.pressed" );
    }

    here is the code used to change the current look and feel :
    try {
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
             catch (InstantiationException e)
                  System.out.println("Error occured  "+ e.toString());
             catch (ClassNotFoundException e)
                  System.out.println("Error occured  "+ e.toString());
             catch (UnsupportedLookAndFeelException e)
                  System.out.println("Error occured  "+ e.toString());
             catch (IllegalAccessException e)
                  System.out.println("Error occured in .. " + e.toString());
             Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
             Fenetre fen = new Fenetre();
             fen.setSize(dim.width, dim.height);
             fen.setResizable(false);
                 fen.setLocation(0, 0);
                  fen.setVisible(true);

  • Push Button look and feel

    Hi,
    I am using forms 10g
    I have a requirement to make the look and feel of the push button like a hyperlink.
    Basically the button background should merge with the canvas background and text should appear on the canvas.
    I have to use push buttons only as i have a require setting mouse navigate property for the buttons to function correctly.
    I tried using image instead of buttons but image does not have mouse navigate property.
    kindly reply as this is becoming a show stopper fr the proposed look and feel in the current project.
    Edited by: user3067156 on May 4, 2010 6:01 AM

    One use case for setting mouse navigate property to yes is mentioned in this link
    http://www.oracle.com/technology/obe/obe_as_10g/bi/forms/formsmasterdetailobe.htm
    When Mouse Navigate is No, Form Builder does not perform navigation to the item when the end user activates it with the mouse. For example, a mouse click in a button or check box is not treated as a navigational event.
    Form Builder fires any triggers defined for the button or check box (such as When-Button-Pressed), but the input focus remains in the current item.
    When Mouse Navigate is Yes, Form Builder navigates to the item, firing any appropriate navigation and validation triggers on the way.
    if the button performs query or cancel mouse navigate is set to No
    if the button performs first ,next, commit record mouse navigate is set to Yes.

  • Problem with java look and feel

    Hi! This is my first time posting here. Do apologize me if I am not familiar with the regulations here. Thanks!
    Currently, I am developing a project using NetBeans IDE. It is using RMI, and some basic UI. I am facing the following error when I tried applying the java look and feel code. Please see below for the code used and the error message.
    try {   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception e) { }
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.plaf.ColorUIResource cannot be cast to java.util.List
    at javax.swing.plaf.metal.MetalUtils.drawGradient(MetalUtils.java:196)
    at javax.swing.plaf.metal.MetalInternalFrameTitlePane.paintComponent(MetalInternalFrameTitlePane.java:384)
    at javax.swing.JComponent.paint(JComponent.java:1027)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5129)
    at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
    at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
    at javax.swing.JComponent.paint(JComponent.java:1013)
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
    at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
    at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
    at java.awt.Container.paint(Container.java:1797)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:734)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
    at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Java Result: 1

    Thanks for everyone's help!
    Below is the executable code generated using NetBeans which is enough to generate the error message. Sometimes you can get the error message just by running the program. Sometimes the error will occur when you go into the Menu and click on Item.
    * NewJFrame.java
    * Created on January 8, 2008, 1:11 PM
    package client;
    import javax.swing.UIManager;
    * @author  Yang
    public class NewJFrame extends javax.swing.JFrame {
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            jDesktopPane1 = new javax.swing.JDesktopPane();
            jInternalFrame1 = new javax.swing.JInternalFrame();
            jMenuBar1 = new javax.swing.JMenuBar();
            jMenu1 = new javax.swing.JMenu();
            jMenuItem1 = new javax.swing.JMenuItem();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
            jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
            jInternalFrame1Layout.setHorizontalGroup(
                jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 190, Short.MAX_VALUE)
            jInternalFrame1Layout.setVerticalGroup(
                jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 95, Short.MAX_VALUE)
            jInternalFrame1.setBounds(80, 40, 200, 130);
            jDesktopPane1.add(jInternalFrame1, javax.swing.JLayeredPane.DEFAULT_LAYER);
            jMenu1.setText("Menu");
            jMenuItem1.setText("Item");
            jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenuItem1ActionPerformed(evt);
            jMenu1.add(jMenuItem1);
            jMenuBar1.add(jMenu1);
            setJMenuBar(jMenuBar1);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE)
                    .addGap(20, 20, 20))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
            pack();
        }// </editor-fold>                       
        private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {                                          
    // TODO add your handling code here:
            jInternalFrame1.setVisible(true);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
                e.printStackTrace();
        // Variables declaration - do not modify                    
        private javax.swing.JDesktopPane jDesktopPane1;
        private javax.swing.JInternalFrame jInternalFrame1;
        private javax.swing.JMenu jMenu1;
        private javax.swing.JMenuBar jMenuBar1;
        private javax.swing.JMenuItem jMenuItem1;
        // End of variables declaration                  
    }Edited by: Boxie on Jan 7, 2008 11:23 PM

  • Look and Feel Issues from NWDS 7.0.9 on Windows 7

    Dear Experts,
    I have successfully installed a new NWDS 7.0.9 on my 18' inch laptop:
      Windows 7 (64Bit)
      JDK 1.4.18 (32Bit)
    The NWDS starts without any problems however, i am begining to experience some erratic behavior from the projects i have created.
    For instance, when i attempt to Edit the Application  Properties for a WDJ project, the neccessary fields (and tabs) are not displayed hence i am unable to edit properties like the 'ExpirationTime' or create new one for that matter.
    In some cases,i am unable to embed a View into a Window because the neccessary fields to aid my selection of the view i want to embed are not visible for interaction.
    The same challenge occurs with EAR project; i am unable to edit 'application-j2ee-engine.xml' fields because they are not visible.
    After some troubleshooting,i discovered that the screen resolution may be affecting the 'Look and Feel' of the NWDS itself,
    If i reduced the resolution from 1024*768 to a value much more lower, some of these controls are displayed but with the desktop completely messed up.
    Does anybody have a solution to my problem because this challenge is affecting my productivity?
    Could my issue be as a result of my laptop screen size (i am using an 18'inch laptop)?
    Best regards,
    Bakau Onafuwa
    Oceanic Bank Int'l PLC

    Hi Vishal,
    first go to the download section in SMP.
    Roughly follow this path (translated from german ;-):
    SAP Software Distribution Center -> Download -> Further Download-Infos -> SAP Support Package Stacks -> SP Stack Download
    From list select SP Stack SAP NetWeaver 2004s
    A new window will pop up:
    1. Select your stack
    2. Usage Selection: Application Server Java
    3. Next Step
    4. Under SAP Kernel xx bit select your DB and OS
    5. Next Step
    6. You get a list of all components of you selected items.
    Here you'll find NWDS with a filename like JIDE09P_1-10003480.SAR
    You know the rest, right?
    Regards,
       ok

  • Stefankrause XP look and feel

    Hi
    I m posting this thread again. Can anyone show the way to get rid of SecretLoader class in Stefankrause look and feel. SerectLoader Code is not available on net , but this is used in Stefankrause XP look and feel.I have tried default icons but does not exactly serve the purpose.
    I've downloded code from
    http://www.stefan-krause.com/java/
    Or if u've info regarding where is icon file for Microsoft Windows XP on Computer that are used in Java, like icons for plus ,minus, or question mark etc.
    Thanx.

    Hi there, I've used this package and u can use DJ - the java decompiler or jad to decomile it. Or event u can use Gel(a Java IDE written in Java) to just double click the class file to view it's source. Gel can be found at http://www.gexperts.com/.
    note the code
    abyte0[l] ^= 0x2a;
    is what the author exactual encode the resource. u can alse use this method to get the original images, in fact, i've done this, hehe. Since abyte ^ 0x2a ^ 0x2a = abyte, this is just a bitwise operation equals.
    // SecretLoader.java
    // Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://kpdus.tripod.com/jad.html
    // Decompiler options: packimports(3)
    package com.stefankrause.xplookandfeel.skin;
    import java.awt.*;
    import java.io.ByteArrayOutputStream;
    import java.io.InputStream;
    import java.net.URL;
    import javax.swing.JPanel;
    public class SecretLoader
    public SecretLoader()
    static Image loadImage(String s)
    URL url;
    url = (com.stefankrause.xplookandfeel.skin.SecretLoader.class).getResource("/com/stefankrause/xplookandfeel/icons/" + s);
    Object obj = null;
    Image image;
    InputStream inputstream = url.openStream();
    ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
    byte abyte0[];
    if(s.endsWith(".res"))
    inputstream.read();
    inputstream.read();
    for(int i = inputstream.read(buffer); i != -1; i = inputstream.read(buffer))
    bytearrayoutputstream.write(buffer, 0, i);
    abyte0 = bytearrayoutputstream.toByteArray();
    for(int l = 0; l < abyte0.length; l++)
    abyte0[l] ^= 0x2a;
    } else
    for(int j = inputstream.read(buffer); j != -1; j = inputstream.read(buffer))
    bytearrayoutputstream.write(buffer, 0, j);
    abyte0 = bytearrayoutputstream.toByteArray();
    int k = inputstream.read(abyte0);
    image = Toolkit.getDefaultToolkit().createImage(abyte0, 0, abyte0.length);
    MediaTracker mediatracker = new MediaTracker(panel);
    mediatracker.addImage(image, 0);
    try
    mediatracker.waitForID(0);
    catch(InterruptedException interruptedexception) { }
    return image;
    Throwable throwable;
    throwable;
    throw new IllegalArgumentException("File " + s + " could not be loaded.");
    static JPanel panel = new JPanel();
    static byte buffer[] = new byte[4096];
    }

  • Motif look and feel

    if i run the following code,it displayes a dialog with missing title text
    import javax.swing.JOptionPane;
    import javax.swing.UIManager;
    public class TestMotif {
         * @param args
         public static void main(String[] args) {
              try
                   //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              JOptionPane.showMessageDialog(null, "done", "Confirmation Dialog for testing",
                        JOptionPane.INFORMATION_MESSAGE);
    in motif look and feel(system look and feel for solaris os)the dialog size is dependent on the message text length not on tilte text length.
    whereas in other look and feel the dialog size is dependent on both message and title text length.I raisedn it in sun's bug but didnt get any reply.Can anyone tell how can it be fixed in jre level.
    Edited by: AGS_CONTACT on Jun 30, 2008 11:07 AM

    It's not the answer you want to hear, but it's pretty simple:
    Write your own JDialog subclass that implements the behavior you want. It should be pretty straightforward to write a JOptionPane message dialog clone.

  • Look and Feel

    Salutations,
    I am writing a simple swing program that when the user clicks a button corresponding to a look and feel name ie "Metal" etc. the Look and Feel is Changed, it works great except for one problem, it will not change to the "Metal" look and feel, I believe this to be the default look and feel, but when changed to another, it will not change back. Any suggestions?
    thanks,
    J

    Here's the code from the SwingSet2 Demo:
    // Possible Look & Feels
        private static final String mac      = "com.sun.java.swing.plaf.mac.MacLookAndFeel";
        private static final String metal    = "javax.swing.plaf.metal.MetalLookAndFeel";
        private static final String motif    = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
        private static final String windows  = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
            try {
                UIManager.setLookAndFeel(currentLookAndFeel);
                SwingUtilities.updateComponentTreeUI(this);
                // where currentLookAndFeel is one of those Strings
            } catch (Exception ex) {
             System.out.println("Failed loading L&F: " + currentLookAndFeel);
             System.out.println(ex);
    // And as an (unexpected) bonus, it's the same as the code I once used:
    static String windowsClassName = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
            try
                javax.swing.UIManager.setLookAndFeel(windowsClassName);
                javax.swing.SwingUtilities.updateComponentTreeUI(this);
            catch(Exception e)

  • How to customize the title bar on my own Look And Feel?

    Hi all!
    I am creating my own Look and Feel which extends from NimbusLookAndFeel. What I'm doing is overwriting UIDefaults values??, referring to the Painters. For example:
    +uiDefault.put ("Button [Enabled]", new ButtonEnabledPainter());+
    But now I need is to customize the title bar of the JFrame's, but I do not see this option in Painter's values ??can be overwritten by Nimbus (http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults . html).
    You know as possible? I have to overwrite an existing UI component? The idea is I want to make the look and feel like SeaGlass, but the code seems a bit complex to know where to begin.
    I hope you can guide me on this issue.
    Thank you very much for everything! And excuse my English!.
    Greetings!

    very simple example, with direct methods
    import java.awt.*;
    import java.awt.event.*;
    import java.util.LinkedList;
    import java.util.Queue;
    import javax.swing.*;
    public class NimbusBorderPainterDemo extends JFrame {
        private static final long serialVersionUID = 1L;
        private JFrame frame = new JFrame();
        private JPanel fatherPanel = new JPanel();
        private JPanel contentPanel = new JPanel();
        private GradientPanel titlePanel = new GradientPanel(Color.BLACK);
        private JLabel buttonPanel = new JLabel();
        private Queue<Icon> iconQueue = new LinkedList<Icon>();
        public NimbusBorderPainterDemo() {
            iconQueue.add(UIManager.getIcon("OptionPane.errorIcon"));
            iconQueue.add(UIManager.getIcon("OptionPane.informationIcon"));
            iconQueue.add(UIManager.getIcon("OptionPane.warningIcon"));
            iconQueue.add(UIManager.getIcon("OptionPane.questionIcon"));
            JButton button0 = createButton();
            button0.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    frame.setExtendedState(ICONIFIED);
            JButton button1 = createButton();
            button1.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    frame.setExtendedState(MAXIMIZED_BOTH | NORMAL);
                }//quick implemented, not correct you have to override both methods
            JButton button2 = createButton();
            button2.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    int confirm = JOptionPane.showOptionDialog(frame,
                            "Are You Sure to Close Application?", "Exit Confirmation",
                            JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,
                            null, null, null);
                    if (confirm == JOptionPane.YES_OPTION) {
                        System.exit(1);
            buttonPanel.setLayout(new GridLayout(0, 3, 5, 0));
            buttonPanel.setPreferredSize(new Dimension(160, 30));
            buttonPanel.add(button0);// JLabel is best and cross_platform JComponents
            buttonPanel.add(button1);// not possible put there witouth set Dimmnesion
            buttonPanel.add(button2);// and LayoutManager, work in all cases better
            titlePanel.setLayout(new BorderLayout());//than JPanel or JCompoenent
            titlePanel.add(new JLabel(nextIcon()), BorderLayout.WEST);
            titlePanel.add(new JLabel("My Frame"), BorderLayout.CENTER);
            titlePanel.setBorder(BorderFactory.createLineBorder(Color.GRAY));
            titlePanel.add(buttonPanel, BorderLayout.EAST);
            JTextField field = new JTextField(50);
            JButton btn = new JButton("Close Me");
            btn.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    System.exit(1);
            contentPanel.add(field);
            contentPanel.add(btn);
            fatherPanel.setLayout(new BorderLayout());
            fatherPanel.add(titlePanel, BorderLayout.NORTH);
            fatherPanel.add(contentPanel, BorderLayout.CENTER);
            frame.setUndecorated(true);
            frame.add(fatherPanel);
            frame.setLocation(50, 50);
            frame.pack();
            frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
            frame.setVisible(true);
            ComponentMover cm = new ComponentMover(frame, titlePanel);
            //by camickr http://tips4java.wordpress.com/2009/06/14/moving-windows/
        private JButton createButton() {
            JButton button = new JButton();
            button.setBorderPainted(false);
            button.setBorder(null);
            button.setFocusable(false);
            button.setMargin(new Insets(0, 0, 0, 0));
            button.setContentAreaFilled(false);
            button.setIcon(nextIcon());
            button.setRolloverIcon(nextIcon());
            button.setPressedIcon(nextIcon());
            button.setDisabledIcon(nextIcon());
            nextIcon();
            return button;
        private Icon nextIcon() {
            Icon icon = iconQueue.peek();
            iconQueue.add(iconQueue.remove());
            return icon;
        private class GradientPanel extends JPanel {
            private static final long serialVersionUID = 1L;
            public GradientPanel(Color background) {
                setBackground(background);
            @Override
            public void paintComponent(Graphics g) {
                super.paintComponent(g);
                if (isOpaque()) {
                    Color background = new Color(168, 210, 241);
                    Color controlColor = new Color(230, 240, 230);
                    int width = getWidth();
                    int height = getHeight();
                    Graphics2D g2 = (Graphics2D) g;
                    Paint oldPaint = g2.getPaint();
                    g2.setPaint(new GradientPaint(0, 0, background, width, 0, controlColor));
                    g2.fillRect(0, 0, width, height);
                    g2.setPaint(oldPaint);
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    try {
                        UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
                    } catch (Exception fail) {
                    UIManager.getLookAndFeelDefaults().put("nimbusFocus", Color.RED);
                    NimbusBorderPainterDemo nimbusBorderPainterDemo = new NimbusBorderPainterDemo();
    }

  • JComboBox Lost Listener on Look and Feel change

    When the user change the Look And Feel on the Fly , any Listener that is done using
    myComboBox.getEditor().getEditorComponent().addXXXListener
    is lost
    I'm using Windows XP Service Pack 2, java 6 build 105
    Does someone have any inputs why this happen or how this can be "fixed" or maybe prevent. Do I'm doing something wrong?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.util.*;
    import java.text.SimpleDateFormat;
    /* ComboBoxDemo2.java requires no other files. */
    public class ComboBoxDemo2 extends JPanel
                               implements ActionListener {
        static JFrame frame;
        JLabel result;
        String currentPattern;
        public ComboBoxDemo2() {
            setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
            String[] patternExamples = {
                     "dd MMMMM yyyy",
                     "dd.MM.yy",
                     "MM/dd/yy",
                     "yyyy.MM.dd G 'at' hh:mm:ss z",
                     "EEE, MMM d, ''yy",
                     "h:mm a",
                     "H:mm:ss:SSS",
                     "K:mm a,z",
                     "yyyy.MMMMM.dd GGG hh:mm aaa"
            currentPattern = patternExamples[0];
            //Set up the UI for selecting a pattern.
            JLabel patternLabel1 = new JLabel("Enter the pattern string or");
            JLabel patternLabel2 = new JLabel("select one from the list:");
            JComboBox patternList = new JComboBox(patternExamples);
            patternList.setEditable(true);
            patternList.addActionListener(this);
    //-------------------------------- XXX------------------------------------------
    //      This KeyListener it is lost when the user change the theme on the fly       
            patternList.getEditor().getEditorComponent().addKeyListener(new KeyAdapter()
            public void keyPressed(KeyEvent e)
             System.out.println(" Key pressed is "+e.getKeyCode());     
            //Create the UI for displaying result.
            JLabel resultLabel = new JLabel("Current Date/Time",
                                            JLabel.LEADING); //== LEFT
            result = new JLabel(" ");
            result.setForeground(Color.black);
            result.setBorder(BorderFactory.createCompoundBorder(
                 BorderFactory.createLineBorder(Color.black),
                 BorderFactory.createEmptyBorder(5,5,5,5)
            //Lay out everything.
            JPanel patternPanel = new JPanel();
            patternPanel.setLayout(new BoxLayout(patternPanel,
                                   BoxLayout.PAGE_AXIS));
            patternPanel.add(patternLabel1);
            patternPanel.add(patternLabel2);
            patternList.setAlignmentX(Component.LEFT_ALIGNMENT);
            patternPanel.add(patternList);
            JPanel resultPanel = new JPanel(new GridLayout(0, 1));
            resultPanel.add(resultLabel);
            resultPanel.add(result);
            patternPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
            resultPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
            add(patternPanel);
            add(Box.createRigidArea(new Dimension(0, 10)));
            add(resultPanel);
            setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
            reformat();
        } //constructor
        public void actionPerformed(ActionEvent e) {
             System.out.println("Action Event");                
            JComboBox cb = (JComboBox)e.getSource();
            String newSelection = (String)cb.getSelectedItem();
            currentPattern = newSelection;
            reformat();
        /** Formats and displays today's date. */
        public void reformat() {
             try {
            Date today = new Date();
            SimpleDateFormat formatter =
               new SimpleDateFormat(currentPattern);
                String dateString = formatter.format(today);
                result.setForeground(Color.black);
                result.setText(dateString);
            }catch (IllegalArgumentException iae) {     
            System.out.println("Ilegal argument Exception");   
            catch (Exception e) {
            System.out.println("Argument Exception");                
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            final JFrame frame = new JFrame("ComboBoxDemo2");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            JComponent newContentPane = new ComboBoxDemo2();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setLayout(new BorderLayout());      
            //frame.setContentPane(newContentPane,BorderLayout.CENTER);
            JMenuBar menuBar = new JMenuBar();
            JMenu theme = new JMenu("Theme");
            ButtonGroup bttnGroup = new ButtonGroup();
            JCheckBoxMenuItem metal = new JCheckBoxMenuItem("Metal");
            bttnGroup.add(metal);
            metal.addActionListener(new ActionListener(){
             public void actionPerformed(ActionEvent e){
              try{
              UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
              SwingUtilities.updateComponentTreeUI(frame);
              }catch(Exception a){a.printStackTrace();}
              theme.add(metal);
            JCheckBoxMenuItem system = new JCheckBoxMenuItem("System");
            bttnGroup.add(system);
            system.addActionListener(new ActionListener(){
             public void actionPerformed(ActionEvent e){
              try{
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              SwingUtilities.updateComponentTreeUI(frame);
              }catch(Exception a){a.printStackTrace();}
            theme.add(system);
            menuBar.add(theme);     
            frame.setJMenuBar(menuBar);
            JToolBar jtb = new JToolBar();
            jtb.add(newContentPane);
            frame.add(jtb, BorderLayout.PAGE_START);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    Thanks to both Rodney_McKay and jasper for their replys and ideas
    This code is working fine
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.util.*;
    import java.text.SimpleDateFormat;
    /* ComboBoxDemo2.java requires no other files. */
    public class ComboBoxDemo2 extends JPanel
                               implements ActionListener {
        static JFrame frame;
        JLabel result;
        String currentPattern;
        private JComboBox patternList = new JComboBox();
        public ComboBoxDemo2() {
            setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
            String[] patternExamples = {
                     "dd MMMMM yyyy",
                     "dd.MM.yy",
                     "MM/dd/yy",
                     "yyyy.MM.dd G 'at' hh:mm:ss z",
                     "EEE, MMM d, ''yy",
                     "h:mm a",
                     "H:mm:ss:SSS",
                     "K:mm a,z",
                     "yyyy.MMMMM.dd GGG hh:mm aaa"
            currentPattern = patternExamples[0];
            //Set up the UI for selecting a pattern.
            JLabel patternLabel1 = new JLabel("Enter the pattern string or");
            JLabel patternLabel2 = new JLabel("select one from the list:");
            patternList = new JComboBox(patternExamples){
            public void updateUI(){
            System.out.println("UPDATE UI");
            super.updateUI();     
            changeUIAddEditorListener();
            changeUIAddEditorListener();
            patternList.setEditable(true);
            patternList.addActionListener(this);
            //Create the UI for displaying result.
            JLabel resultLabel = new JLabel("Current Date/Time",
                                            JLabel.LEADING); //== LEFT
            result = new JLabel(" ");
            result.setForeground(Color.black);
            result.setBorder(BorderFactory.createCompoundBorder(
                 BorderFactory.createLineBorder(Color.black),
                 BorderFactory.createEmptyBorder(5,5,5,5)
            //Lay out everything.
            JPanel patternPanel = new JPanel();
            patternPanel.setLayout(new BoxLayout(patternPanel,
                                   BoxLayout.PAGE_AXIS));
            patternPanel.add(patternLabel1);
            patternPanel.add(patternLabel2);
            patternList.setAlignmentX(Component.LEFT_ALIGNMENT);
            patternPanel.add(patternList);
            JPanel resultPanel = new JPanel(new GridLayout(0, 1));
            resultPanel.add(resultLabel);
            resultPanel.add(result);
            patternPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
            resultPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
            add(patternPanel);
            add(Box.createRigidArea(new Dimension(0, 10)));
            add(resultPanel);
            setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
            reformat();
        } //constructor
        public void actionPerformed(ActionEvent e) {
             System.out.println("Action Event");                
            JComboBox cb = (JComboBox)e.getSource();
            String newSelection = (String)cb.getSelectedItem();
            currentPattern = newSelection;
            reformat();
        /** Formats and displays today's date. */
        public void reformat() {
             try {
            Date today = new Date();
            SimpleDateFormat formatter =
               new SimpleDateFormat(currentPattern);
                String dateString = formatter.format(today);
                result.setForeground(Color.black);
                result.setText(dateString);
            }catch (IllegalArgumentException iae) {     
            System.out.println("Ilegal argument Exception");   
            catch (Exception e) {
            System.out.println("Argument Exception");                
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            final JFrame frame = new JFrame("ComboBoxDemo2");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            JComponent newContentPane = new ComboBoxDemo2();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setLayout(new BorderLayout());      
            //frame.setContentPane(newContentPane,BorderLayout.CENTER);
            JMenuBar menuBar = new JMenuBar();
            JMenu theme = new JMenu("Theme");
            ButtonGroup bttnGroup = new ButtonGroup();
            JCheckBoxMenuItem metal = new JCheckBoxMenuItem("Metal");
            bttnGroup.add(metal);
            metal.addActionListener(new ActionListener(){
             public void actionPerformed(ActionEvent e){
              try{
              UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
              SwingUtilities.updateComponentTreeUI(frame);
              }catch(Exception a){a.printStackTrace();}
              theme.add(metal);
            JCheckBoxMenuItem system = new JCheckBoxMenuItem("System");
            bttnGroup.add(system);
            system.addActionListener(new ActionListener(){
             public void actionPerformed(ActionEvent e){
              try{
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              SwingUtilities.updateComponentTreeUI(frame);
              }catch(Exception a){a.printStackTrace();}
            theme.add(system);
            menuBar.add(theme);     
            frame.setJMenuBar(menuBar);
            JToolBar jtb = new JToolBar();
            jtb.add(newContentPane);
            frame.add(jtb, BorderLayout.PAGE_START);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
       public void changeUIAddEditorListener() {
       patternList.getEditor().getEditorComponent().addKeyListener(new KeyAdapter()
       public void keyPressed(KeyEvent e)
       System.out.println(" Key pressed is "+e.getKeyCode());     
    }

  • Jdeveloper doesn't show inspect pop up while look and feel is windows

    Jdeveloper doesn't show inspect pop up while look and feel is windows

    Thanks for looking at the issue Frank. Here are the points:
    1. I debugging a java application using Jdeveloper 11g IDE
    2. I had modified the IDE look and feel to windows.
    3. The debugger stopped at a breakpoint and i tried to inspect the value of an expression.
    3.1. Select that expression using mouse.
    3.2. Right click on the expression
    3.3. click on the inspect option.
    4. I was expecting a pop-up window to appear. But it didn't come.
    5. Later i changed look and feel of IDE to Oracle/fusion(blue) which is the default.
    6. Repeated step 3.
    7. Got a pop up window and was able to inspect the value.
    Hope this info helps.
    -Sandeep.
    Edited by: Sandeep.Sundaram on Oct 17, 2008 2:13 PM

Maybe you are looking for

  • Problem with replace text in file

    Hi! I have some file (*.txt) and I want to replace some strings in this file, which are stay in different positions in the file. How I can do this? My code is: 1String fileName = filePath + File.separator + "text.txt"; 2.FileWriter fileWriter = new F

  • Auto Login to Wiki

    We are having issues wth the auto login to the OSX Server wiki. It seems to work overnight sometimes, when the browser is closed, then occasionally it will log you out within half an hour of closing the browser. Can anyone enlighten me on how this co

  • D1000 Max Disk Size

    I have found conflicting information. I am hoping one if the experts here can help. I am trying to find out what the max disk size is for the D1000's. The handbook says 73GB but the sunstore sells 146GB drives that are for the D1000. So which is it?

  • Pink line down left side of screen?

    I recently popped an Arch CD into my newly (sort of) built computer and the install went great. I rebooted, and I was presented with a thin pink line down the left side of my screen. What is this thing (sorry for bad quality pictures. I used a phone

  • My mouse freezes in adobe muse can not move objects

    the problem is that my mouse after a few minutes it freezes and will not let me move objects. this happens with adobe muse 2014.2 and the worst is that my file can not be opened with earlier versions ( help)