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);

Similar Messages

  • How Can I Create a Custom Panel With the InDesign ToolBar's Look and Feel

    I am trying to create a custom panel that looks as close as possible to InDesign's native floating menu bar (with the Frame, Text, etc, icons on it). ToggleBarButtons doesn't look like, although it does contain the functinoality of the button which is pressed stayting pressed.
    Any ideas?
    TIA,
    mlavie

    Hi mlavie,
    I found a nice post on this topic at:
    http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in- flex/
    Hope this helps!
    Thanks,
    Ole

  • Customised look and feel for B2B/B2C web shop.

    Dear experts,
                I would like to find out if there is an admin page for SAP E-commerce to customise the look and feel of the webshop?
    Thanks.
    Wein

    Hi Wein,
    To change Look and Feel for Web shop is depends on scenario of eCommerce application i.e. B2B or B2C. B2B has different structure than B2C.
    Web Channel application comes in SAP standard with SAP look and Feel. You have to change look and feel as per client requirement.
    To change look and feel of Both B2B/B2C scenario you have to deal with files like CSS, JSP, Properties, XLF and some time you have to add your custom JAVA, JSP, CSS, Properties files etc...
    To change standard SAP logo youhave to make change in CSS files. Also you have to consider Browser type while changing look and feel because to display your B2B/B2C application correctly in different browser you have to make changes in different CSS.
    You will get better idea with example how to change look and feel in "Dev & Ext. Guide" for Web Shop. You will get this from Service Market place.
    eCommerce Developer.

  • SCOM - -500 Internal Server Error - There is a problem with the resource you are looking for, and it cannot be displayed

    Hi There,
    Need your assistance on the issue that we are facing in prod environment.
    We are able to open web console from remote machine and able to view monitoring pane as well as my workplace folders from console . Able to view and access alerts and other folder in the monitoring pane. We are able to view and access My Workplace folder
    and able to view the reports in Favorite Reports folder. But when I click on run Report we  are getting the below error  "500 Internal Server Error - There is a problem with the resource you are looking for, and it cannot be displayed."
    In our environment we have 3 servers one is SQL server and two are SCOM servers. Please advise how to fix this issue. Do we have to do any thing from SQL End?
    Errors: Event ID 21029: Performance data from the OpsMgr connector could not be collected since opening the shared data failed with error "5L".
     Event ID 6002 : Performance data from the Health Service could not be collected since opening the shared data failed with error 5L (Access is denied.).
    Regards,
    Sanjeev Kumar

    Duplicate thread:
    http://social.technet.microsoft.com/Forums/en-US/7675113e-49f0-4b3a-932b-4aceb3cfa981/scom-500-internal-server-error-there-is-a-problem-with-the-resource-you-are-looking-for-and-it?forum=operationsmanagerreporting
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • 502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream cont

    I am getting error while accessing url of lyncweb.domain.com, dialin.domain.com and meet.domain.com pointing to RP server.
    502 - Web server received an invalid response while acting as a gateway or proxy server.
    There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
    Regards, Ganesh, MCTS, MCP, ITILV2 This posting is provided with no warranties and confers no rights. Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    When i try with https://lyncfrontend.domain.local:4443 and https://lyncfrontend.domain.com:4443 both opens but when i open the external domain name i get certificate .
    ARR version installed is 3.0
    To throw more light on the configuration:
    Lync 2013 implemented, internal domain name is : domain.local and external domain name is : domain.com
    All servers in VMs are with 4 core processor, 24gb ram, 1TB drive.
    Frontend : Windows 2012r2 with Lync 2012 Standard Edition - 1 No (192.168.10.100)
    Edge : Windows 2012 with Lync 2012 Std - 1 No 
    (192.168.11.101 DMZ) in workgroup
    ISS ARR Reverse Proxy 3.0 : Windows 2012 with ARR and IIS configured. (192.168.11.102)
    Certificate : Internal Domain root CA for internal and External (Digicert).
    Internal Network : 192.168.10.x /24
    External Network (DMZ) : 192.168.11.x /24
    Public Firewall NAT to DMZ ip for firewall and RP server. So having two public IP facing external network.
    Edge has : sip.domain.com, webconf.domain.com, av.domain.com
    IIS ARR RP server has : lyncdiscover.domain.com, lyncweb.domain.com, meet.domain.com, dialin.domain.com
    Have created SRV record in public : _sip.tls.domain.com >5061>sip.domain.com, _sipfederationtls._tcp.domain.com>5061>sip.domain.com, _xmpp-server._tcp.domain.com>5269>sip.domain.com
    Installed frontend server using MS Lync server 2013 step by step for anyone by Matt Landis, Lync MVP.
    Internal AD Integrated DNS pointing Front-end
    Type of Record FQDN
    IP Description 
    A sip.domain.com
    192.168.10.100 Address internal Front End  or Director for internal network clients 
    A admin.domain.com
    192.168.10.100 URL Administration pool
    A DialIn.domain.com
    192.168.10.100 URL Access to Dial In 
    A meet.domain.com
    192.168.10.100 URL of Web services meeting
    A lyncdiscoverinternal.domain.com
    192.168.10.100 Register for Lync AutoDiscover service to internal users
    A lyncdiscover.domain.com
    192.168.10.100 Register for Lync AutoDiscover service to external users  
    SRV Service: _sipinternaltls Protocol: _tcp Port: 5061
    sip.domain.com Record pointer services to internal customer connections using TLS 
    External DNS pointing Edge & Proxy
    Type of Record FQDN
    IP Endpoint
    A sip.domain.com
    x.x.x.100 Edge
    A webconf.domain.com
    x.x.x.100 Edge
    A av.domain.com
    x.x.x.100 Edge
    SRV _sip._tls.domain.com
    sip.domain.com: 443 Edge
    SRV _sipfederationtls._tcp.domain.com
    sip.domain.com:5061 Edge
    A Meet.domain.com
    x.x.x.110 Reverse Proxy
    A Dialin.domain.com
    x.x.x.110 Reverse Proxy
    A lyncdiscover.domain.com
    x.x.x.110 Reverse Proxy
    A lyncweb.domain.com
    x.x.x.110 Reverse Proxy
    In IIS ARR proxy server following server farms are added and configured as per link ttp://y0av.me/2013/07/22/lync2013_iisarr/
    In proxy server had setup only following server farm : While running remote connectivity web service test : meet, dialin, lyncdiscover and lyncweb.
    The client inside works fine internally and through vpn. Login with external client also working fine. But we are getting error in MRCA as follows.
    a) While testing remote connectivity for lync getting error : The certificate couldn't be validated because SSL negotiation wasn't successful. This could have occurred as a result of a network error or because of a problem with the certificate installation.
    Certificate was installed properly.
    b) For remote web test under Lync throws error : A Web exception occurred because an HTTP 502 - BadGateway response was received from IIS7.
    HTTP Response Headers:
    Content-Length: 1477
    Content-Type: text/html
    Date: Wed, 14 May 2014 10:03:40 GMT
    Server: Microsoft-IIS/8.0
    Elapsed Time: 1300 ms.
    Regards, Ganesh, MCTS, MCP, ITILV2 This posting is provided with no warranties and confers no rights. Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

  • 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

  • Transparent TextField with Synth Look and Feel

    I am trying to use synth to implement a textfield with a transparent background, and having some problems with it. I can see my panel and the transparent field fine enough in the beginning, but when the text in the field changes, it writes right over the previous text and becomes a pile of unreadable white marks. I've experimented with varying degrees of transparency, but you can still see the old field underneath slightly. Does anyone have any suggestions? My code is below.
    Thanks.
    synth.xml
    <synth>
    <!-- PANEL -->
    <style id="panelStyle">
        <state>
            <imagePainter method="panelBackground" path="../../../lafImages/papyrus_bkgd.gif" sourceInsets="10 15 10 15"/>
        </state>
    </style>
    <bind style="panelStyle" type="name" key="PAPYRUS_PANEL"/>
    <!-- TEXTFIELD -->
    <style id="textFieldStyle">
        <font name="Kudasai" size="12"/>
        <state>
            <color type="TEXT_FOREGROUND" value="#FFFFFF"/>
            <!-- set the alpha value for transparency in 1st two digits -->
            <color type="BACKGROUND" value="#00000000"/>
        </state>
        <opaque value="false"/>
    </style>
    <bind style="textFieldStyle" type="region" key="TEXTFIELD"/>
    </synth>
    my tester
    class SynthTester {
        private JTextField field;
        public SynthTester(){
            initLookAndFeel();
            JFrame main = new JFrame();
            JPanel panel = new JPanel();
            panel.setName("PAPYRUS_PANEL");
            field = new JTextField(3);
            field.setText("0");
            panel.add(field);
            JButton button = new JButton("+");
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    int val;
                    try {
                        val = Integer.parseInt(field.getText());
                    } catch( Exception ex ) {
                        val = 0;
                    val++;
                    field.setText(Integer.toString(val));
            panel.add(button);
            main.add(panel);
            main.pack();
            main.setVisible(true);
        private void initLookAndFeel() {
            SynthLookAndFeel lookAndFeel = new SynthLookAndFeel(); 
            try {
                InputStream is = getClass().getResourceAsStream("synth.xml");
                if( is == null) {
                    System.err.println("unable to load resource stream");
                } else {
                    lookAndFeel.load(is, getClass());
                    UIManager.setLookAndFeel(lookAndFeel);
            } catch (Exception e) {
                System.err.println("Couldn't get specified look and feel ("+ lookAndFeel+ "), for some reason.");
                System.err.println("Using the default look and feel.");
                e.printStackTrace();
                System.exit(1);
    }

    As its name implies, an imagePainter element creates a SynthPainter that paints from an image. For example:
    <synth>
    <style id="example">
    <state>
    <color value="white" type="BACKGROUND"/>
    </state>
    <imagePainter method="panelBackground" path="background.png"
    sourceInsets="5 6 6 7" paintCenter="false"/>
    <insets top="5" bottom="6" right="7" left="6"/>
    </style>
    <bind style="example" type="region" key="Panel"/>
    </synth>

  • I  have a problem with the synchronisation of my iPhone and iPad with Outlook 2007 on my 64-bit Windows 7  PC. For several years, I have had no problems with the synchronisation by cord connection and iTunes between these programmes. However, a few months

    I  have a problem with the synchronisation of my iPhone and iPad with Outlook 2007 on my 64-bit Windows 7  PC. For several years,
    I have had no problems with the synchronisation by cord connection and iTunes between these programmes. However, a few months ago I decided to use Mobile Me. However, there were problems with duplication of calendars and then “rogue events” – which could not be deleted – even if deleted on Outlook and on the iPhone (or both at the same time) – they would just reappear after the next synchronisation.  All other synchronisation areas (eg Contacts, Notes etc) work fine.
    I have looked for help through the Apple Support Community and tried many things.  I have repaired my Outlook. I have repaired my .pst file in Windows. I have re-installed the latest version of iTunes on my PC. I have re-installed the firmware on my iPhone. I have tried many permutations on my iPhone. I have closed down all Mobile Me functions on the iPhone. I have spent upwards of 24 hours trying to solve this problem.
    What am I left with? Outlook works seamlessly on my PC. My iPhone calendar now has no events from  my calendar, but does not synchronise through iTunes. Nor does it send events initiated on the iPhone to the Outlook. I am at the point of abandoning iPhones and iPads altogether.  I need to have a properly synchronising calendar on my phone.  Do you have any suggestions?

    In the control panel goto the "Lenovo - Power Manager" and click the battery tab, there is a maintenance button in there that will let you change the charging profile for your battery.   (from memory, so exact wording may be off)
     The lower the numbers you use there, the longer the battery *should* last.    These batteries degrade faster at higher charge levels, however storing them at too low of levels is also not good for them... I've read that 40% is optimal, but just not realistic if you use your computer.
    --- ThinkPad T61 / Win 7 / Core 2 / 4gb RAM / Nvidia / Still used daily --- ThinkPad Edge 15/ i5 / Win 7 / TrueCrypt / 8gb RAM / Hated it, died at 1 yr 1 mo old --- ThinkPad T510 / Win 7 / TrueCrypt / i5 / 8gb RAM / Nvidia / Current primary machine --- ThinkPad X220 / i7 / IPS / 4gb / TrueCrypt / My Road Machine

  • I am having a problem with my cs6 running very slow and when i save i am getting an error message that says, "This document is bigger than 2 gb (the file may not be read correctly by some TIFF viewers.) please help

    I am having a problem with my cs6 running very slow and when i save i am getting an error message that says, "This document is bigger than 2 gb (the file may not be read correctly by some TIFF viewers.) please help

    wen6275,
    It looks like you're actually using a camera or phone to take a photo of your monitor.
    That's not what is commonly known as a "screen shot". 
    It looks like you're on a Mac.  Hitting Command+Shift+3 places a capture of the contents of your entire monitor on your Desktop; hitting Command+Shift+4 will give you a cross-hairs cursor for you to select just the portion you want to capture.
    I'm mentioning this because I fear I'm not construing your original post correctly when you type "I am working with a large files [sic], currently it has 149 layers, all of which are high resolution photographs", so I'm wondering if there's some similar use of your own idiosyncratic nomenclature in your description of your troublesome file.
    Perhaps I'm just having a major senior moment myself, but I'm utterly unable to imagine such a file.  Would you mind elaborating?

  • Problem setting look and feel

    It seems like I'm not able to change the windows xp look and feel, I'm using this code to change it but nothing happens, the window comes out with windows LAF:
    " public static void main(String[] args)
    try {
    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (Exception e) { System.out.println(e.getMessage()); }
    new Ventana();
    Maybe... Am I missing some code? or a specific class needs to be downloaded?
    I'd apreciate any help

    That was not the problem, but thank you...
    I finally noticed the problem, what I was trying to do was actually done by writting this:
    JComponent.setDefaultLookAndFeelDecorated(true);
    Sets the OceanTheme feel on, but I noticed that when you try to use it with a Jdialog and a JFileChooser you get some ugly colors. Orange/Brown with JDialogs and Green with JFileChoosers. Is this a bug or it's ment to do that?
    Does somebody know how to fix it?
    Thanks for your support

  • Swing disabled components look and feel problem.

    Hi All,
    I have a Swing application. My system is recently upgraded to JRE 1.6 and I'm facing problem with look and feel of swing components when they are disabled. Color of disabled components is very faint and its being difficult to read the text in such disabled components. In JRE 1.4 this problem was not there. Please let me know what I can do to get the look and feel(Color and Font) of disabled components, same as JRE 1.4.
    Thanks

    Sandip_Jarad wrote:
    ..I have a Swing application. My system is recently upgraded to JRE 1.6 and I'm facing problem with look and feel of swing components when they are disabled. Which look and feel is the application using? As an aside, did it never occur to you to mention the PLAF?
    ..Color of disabled components is very faint and its being difficult to read the text in such disabled components. Why is it so gosh-darned important to read the text on a control that is (supposedly) not relevant or not available?
    ..In JRE 1.4 this problem was not there. Please let me know what I can do to get the look and feel(Color and Font) of disabled components, same as JRE 1.4. Here are some suggestions, some of them are actually serious. I'll leave it as an exercise for you, to figure out which ones.
    - Run the app. in 1.4.
    - Use a custom PLAF that offers a 'less faint' rendering of disabled components.
    - Use Motif PLAF (I haven't checked, but I bet that has not changed since 1.4).
    - Put the important text in a tool-tip.

  • NetBeans: Dinamically changing Look and Feel Problem

    Hi there, Java lovers.
    I need some help here!
    I love java, and I used to program my graphical user interfaces by hand. In my applications, there is a dropdown for the user to chose the desired look and feel. Then I save the selected option to a file and on the startup I do something like this:
                UIManager.setLookAndFeel(savedUserSelectedLookAndFeel);That always worked really fine. The look and feel would change and everything worked really well.
    However, programing GUI by hand is really a PITA. So I was seduced by Netbeans. I am using Netbeans 6.0 on Windows XP, and I designed the GUIs really fast now.
    The problem is, the system look and feel works really well, but when I change the look and feel of my application to a different one (Java/Motif/etc..) the look and feel changes but the components positions and sizes becomes all messed up. It really becomes impossible to work with a different look and feel because some components are outside of frames.
    I believe the cause of this is because Netbeans generates the code automatically using Grids and stuff like that, and by doing so, the change of the look and feel becomes messed up. This is a thing that would not happen with my manually created code.
    This is really troubling me. Does someone has the same problem. Is there something I can do? Or do I need to create my GUIs by hand like before?

    Oyashiro-sama (&#23569;&#12375;&#26085;&#26412;&#35486;&#12434;&#30693;&#12387;&#12390;&#12356;&#12427;&#12375;&#12289;&#12381;&#12435;&#12394;&#12300;&#27096;&#12301;&#12387;&#12390;&#12356;&#12358;&#20351;&#12356;&#26041;&#12399;&#12385;&#12423;&#12387;&#12392;&#22793;&#12381;&#12358;&#12391;&#12377;&#12397;&#12288;(^_-) &#12300;&#20887;&#35527;&#12301;&#12387;&#12390;&#12356;&#12358;&#38996;&#25991;&#23383;&#12391;&#12377;&#12290;&#65289;
    Sorry for the delay in reply, but one problem for you is that this is not a NetBeans users forum, thus you will not necessarily receive speedy replies here to your NetBeans questions. The best place to send NetBeans questions is:
    [email protected]
    [email protected] (for NetBeans API issues)
    As for your question, you seem to already know quite a bit about NetBeans UI Look and Feel programming, but have you seen these:
    WORKING WITH SWING LOOK AND FEEL:
    http://java.sun.com/developer/JDCTechTips/2004/tt0309.html#1
    Java GUI Swing Programming Using NetBeans 5 (should apply to NetBeans 6):
    http://wiki.netbeans.org/JavaGUISwingProgrammingUsingNetBeans5
    Regards,
    -Brad Mayer

  • Hey Guys i have a problem with my mac since last month and it wont boot up it freezes in a grey apple logo and and spinning gear any body know how to fix this?

    Hey Guys i have a problem with my mac since last month and it wont boot up it freezes in a grey apple logo and and spinning gear any body know how to fix this?

    Take each of these steps that you haven't already tried. Stop when the problem is resolved.
    Step 1
    The first step in dealing with a boot failure is to secure your data. If you want to preserve the contents of the startup drive, and you don't already have at least one current backup, you must try to back up now, before you do anything else. It may or may not be possible. If you don't care about the data that has changed since your last backup, you can skip this step.
    There are several ways to back up a Mac that is unable to boot. You need an external hard drive to hold the backup data.
    a. Boot into Recovery by holding down the key combination command-R at the startup chime, or from a local Time Machine backup volume (option key at startup.) Release the keys when you see a gray screen with a spinning dial. When the OS X Utilities screen appears, launch Disk Utility and follow the instructions in the support article linked below, under “Instructions for backing up to an external hard disk via Disk Utility.”
    How to back up and restore your files
    b. If you have access to a working Mac, and both it and the non-working Mac have FireWire or Thunderbolt ports, boot the non-working Mac in target disk mode by holding down the key combination command-T at the startup chime. Connect the two Macs with a FireWire or Thunderbolt cable. The internal drive of the machine running in target mode will mount as an external drive on the other machine. Copy the data to another drive. This technique won't work with USB, Ethernet, Wi-Fi, or Bluetooth.
    How to use and troubleshoot FireWire target disk mode
    c. If the internal drive of the non-working Mac is user-replaceable, remove it and mount it in an external enclosure or drive dock. Use another Mac to copy the data.
    Step 2
    Press and hold the power button until the power shuts off. Disconnect all wired peripherals except those needed to boot, and remove all aftermarket expansion cards. Use a different keyboard and/or mouse, if those devices are wired. If you can boot now, one of the devices you disconnected, or a combination of them, is causing the problem. Finding out which one is a process of elimination.
    Before reconnecting an external storage device, make sure that your internal boot volume is selected in the Startup Disk pane of System Preferences.
    Step 3
    Boot in safe mode.* The instructions provided by Apple are as follows:
    Shut down your computer, wait 30 seconds, and then hold down the shift key while pressing the power button.
    When you see the gray Apple logo, release the shift key.
    If you are prompted to log in, type your password, and then hold down the shift key again as you click Log in.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    *Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t boot in safe mode. Post for further instructions.
    When you boot in safe mode, it's normal to see a dark gray progress bar on a light gray background. If the progress bar gets stuck for more than a few minutes, or if the system shuts down automatically while the progress bar is displayed, your boot volume is damaged and the drive is probably malfunctioning. In that case, go to step 5.
    If you can boot and log in now, empty the Trash, and then open the Finder Info window on your boot volume ("Macintosh HD," unless you gave it a different name.) Check that you have at least 9 GB of available space, as shown in the window. If you don't, copy as many files as necessary to another volume (not another folder on the same volume) and delete the originals. Deletion isn't complete until you empty the Trash again. Do this until the available space is more than 9 GB. Then reboot as usual (i.e., not in safe mode.)
    If the boot process hangs again, the problem is likely caused by a third-party system modification that you installed. Post for further instructions.
    Step 4
    Sometimes a boot failure can be resolved by resetting the NVRAM.
    Step 5
    Launch Disk Utility in Recovery mode (see above for instructions.) Select your startup volume, then run Repair Disk. If any problems are found, repeat until clear. If Disk Utility reports that the volume can't be repaired, the drive has malfunctioned and should be replaced. You might choose to tolerate one such malfunction in the life of the drive. In that case, erase the volume and restore from a backup. If the same thing ever happens again, replace the drive immediately.
    This is one of the rare situations in which you should also run Repair Permissions, ignoring the false warnings it produces. Look for the line "Permissions repaired successfully" at the end of the output. Then reboot as usual.
    Step 6
    Boot into Recovery again. When the OS X Utilities screen appears, follow the prompts to reinstall the OS. If your Mac was upgraded from an older version of OS X, you’ll need the Apple ID and password you used to upgrade.
    Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with proxy servers, or with networks that require a certificate for authentication.
    Step 7
    Repeat step 6, but this time erase the boot volume in Disk Utility before installing. The system should automatically reboot into the Setup Assistant. Follow the prompts to transfer your data from a backup.
    Step 8
    If you get this far, you're probably dealing with a hardware fault. Make a "Genius" appointment at an Apple Store to have the machine tested.

  • Problems with Mac OSX 10.5.2 and installing my pro tools le 7.1.1

    Problems with Mac OSX 10.5.2 and installing my pro tools le 7.1.1.
    My garage band & reason software don´t open anymore giving me a error messasge regarding the midi drivers in the operating system.
    Please help!!!
    Thanks,
    Paolo

    Somewhere at either Macworld or here I learned that DVDSP 2, DVDSP 3 and now DVDSP 4 "internally" are major re-writes.
    Support for HD among a few other items along with QT 7 which comes with Tiger means sincerely that one set of applications/OS is not going to be stable.
    Personally I think of all the issues possible its DVDSP vs QT.
    Unless you move to DVDSP v4 the alternative is to wipe the disk and go back to Jaguar (10.2) or perhaps Panther but avoid upgrading QT beyond 6. I advocate wiping the disk because I'n not sure an archive and install to down shift to an earlier version of the OS is possible. If it is I'd still worry about mis-matched files in all sorts of locations.

  • TS3694 good evening i have an problem with my iphone 4 the wif and network cant on now if i tray is showing iTunes i tray to reload the ios is showing an error -1 can you help me

    good evening i have an problem with my iphone 4 the wif and network cant on now if i tray is showing iTunes i tray to reload the ios is showing an error -1 can you help me

    No problem, glad to help!
    Update: my PC USB hub was connected to a USB 3 port, I connected the 30 pin cable directly to my PC, And the restore worked just fine. Restored phone from iCloud backup and seems to be working fine.

Maybe you are looking for