JideSplitButton in a toolbar

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

JideSplitButton in a toolbar

Postby robert » Thu Mar 26, 2009 7:58 am

I have found that the JideSplitButton appears and behaves differently if it is added to a toolbar (as opposed to a JPanel). In the code sample below, the JideButton in the toolbar has a border, while the JideSplitButton does not. Also, when the mouse is moved over the JideSplitButton, a thick border appears and does not go away when the JideButton receives the focus. I have added the same buttons to a JPanel so you can see the difference in behaviour. Is this a bug? Is there any workaround? I would like to add a JideSplitButton to a toolbar, but I can't if it looks different than the other buttons in the toolbar.

Thanks

Code: Select all
import com.jidesoft.swing.JideButton;
import com.jidesoft.swing.JideSplitButton;

import javax.swing.*;
import java.awt.*;

public class JideButtonTest extends JFrame {

    public JideButtonTest() {

        JToolBar toolbar = new JToolBar();
        toolbar.add(new JideSplitButton("JideSplitButton"));
        toolbar.add(new JideButton("JideButton"));
      
      JPanel buttonPanel = new JPanel();
      buttonPanel.add(new JideSplitButton("JideSplitButton"));
      buttonPanel.add(new JideButton("JideSplitButton"));
      
        getContentPane().add(toolbar, BorderLayout.NORTH);
        getContentPane().add(buttonPanel, BorderLayout.SOUTH);
       
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        pack();
        setVisible(true);

    }

    public static void main(String[] args) {

        new JideButtonTest();
    }
}

robert
 
Posts: 41
Joined: Thu Apr 03, 2008 6:56 am

Re: JideSplitButton in a toolbar

Postby JIDE Support » Wed Apr 01, 2009 4:05 pm

Thanks for sample code. We have fixed the focus related painting issue. Will let you know when we have next version released.

Regarding the border issue, we would recommend you use our CommandBar instead of JToolBar. The border was added by JToolBar and we have no control of its behavior. We tried JToolBar#setRollOver(boolean) to set its border based on the Javadoc however failed. So we have to recommend you use CommandBar instead.

Below is the sample code if you like the borders.
Code: Select all
        CommandBar toolbar = new CommandBar();
        JideSplitButton button1 = new JideSplitButton("JideSplitButton");
        button1.setBorder(BorderFactory.createEtchedBorder());
        button1.setBorderPainted(true);
        toolbar.add(button1);
        JideButton button2 = new JideButton("JideButton");
        button2.setBorder(BorderFactory.createEtchedBorder());
        button2.setBorderPainted(true);
        toolbar.add(button2);


Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JideSplitButton in a toolbar

Postby JIDE Support » Tue Apr 14, 2009 8:54 pm

Just so you know, this is fixed in 2.6.0 which was just released. The first button will initially have focus but if you press tab, the border will be gone.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JideSplitButton in a toolbar

Postby robert » Wed Apr 15, 2009 10:22 am

Thanks for the fix, looks great. I did notice one other issue today. On a Mac, the splitButton looks like it is in a disabled state, even though it is enabled. This problem only occurs when using the Mac look and feel. If I use Metal or other laf, the problem does not occur. I have attached a screen shot so you can see what I mean. The first button is a JideButton, the second button is a jideSplitButton. They have been added to a JToolBar.
Attachments
toolbar.png
toolbar.png (6.82 KiB) Viewed 30986 times
robert
 
Posts: 41
Joined: Thu Apr 03, 2008 6:56 am

Re: JideSplitButton in a toolbar

Postby JIDE Support » Thu Apr 16, 2009 3:17 pm

I fixed it and checked in to JCL. Next release will include it. Will let you know when it is released.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JideSplitButton in a toolbar

Postby JIDE Support » Fri Apr 17, 2009 9:45 pm

Just so you know, this is fixed in 2.6.1 which was just released.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JideSplitButton in a toolbar

Postby robert » Mon Apr 20, 2009 2:47 pm

Thanks for the quick fix! I finished my toolbar today using jide buttons and the split button. Everything looks great and I did not encounter any new issues.
robert
 
Posts: 41
Joined: Thu Apr 03, 2008 6:56 am

Re: JideSplitButton in a toolbar

Postby fotakis » Thu Jun 24, 2010 5:03 am

Hello,

I am sorry to revive this thread, but I am using 2.7.1 the oss layer, and the problem with the disabled state on a JToolbar still persists, in my test case. I am running the same exact code as in the first post.

Any ideas?
fotakis
 
Posts: 7
Joined: Wed Oct 10, 2007 4:35 am

Re: JideSplitButton in a toolbar

Postby JIDE Support » Thu Jun 24, 2010 10:44 am

Running the test case again, I can't seem to find any incorrect painting. Since you mentioned disabled state, I also tried to invoke JideSplitButton#setEnabled(false) or JToolBar#setEnabled(false). Both approach seem work fine to me either. Would you please share with us the steps to reproduce the issue?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JideSplitButton in a toolbar

Postby fotakis » Mon Jun 28, 2010 2:35 am

Hello again,

I am attaching an image where you can see the problem with the code from the first post. My configuration:


java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)

Jide-oss 2.7.1
Code: Select all
package com.existanze.testing.TreeTable;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JToolBar;

import com.jidesoft.swing.JideButton;
import com.jidesoft.swing.JideSplitButton;

public class JideButtonTest extends JFrame{

   public JideButtonTest() {
      JToolBar toolbar = new JToolBar();
      toolbar.add(new JideSplitButton("JideSplitButton"));
      toolbar.add(new JideButton("JideButton"));
      
      JPanel buttonPanel = new JPanel();
      buttonPanel.add(new JideSplitButton("JideSplitButton"));
      buttonPanel.add(new JideButton("JideSplitButton"));
      
      getContentPane().add(toolbar, BorderLayout.NORTH);
      getContentPane().add(buttonPanel, BorderLayout.SOUTH);
      
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      pack();
   }
   
   public static void main(String[] args) {
      new JideButtonTest().setVisible(true);
   }
}

Attachments
jidebuttonbug.png
jidebuttonbug.png (14.01 KiB) Viewed 30567 times
fotakis
 
Posts: 7
Joined: Wed Oct 10, 2007 4:35 am

Re: JideSplitButton in a toolbar

Postby JIDE Support » Mon Jun 28, 2010 11:37 am

Do you mean those two vertical lines in the left of the tool bar? Looks to me it's a gripper in Mac system. Would you please double confirm that? You could verify it by adding normal button first then JideSplitButton.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JideSplitButton in a toolbar

Postby fotakis » Mon Jun 28, 2010 11:50 am

Hello,

No I mean that the JideSplitButton is rendered as disabled even though it is not when added to a JToolBar!
fotakis
 
Posts: 7
Joined: Wed Oct 10, 2007 4:35 am

Re: JideSplitButton in a toolbar

Postby JIDE Support » Mon Jun 28, 2010 3:54 pm

Would you please give JIDE 2.7.8, 2.8.7 or 2.9.3 a try? I tried all those releases with the test case but could not notice the issue.

Is there any possibility that you have a older jide jar in your class path?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JideSplitButton in a toolbar

Postby fotakis » Tue Jun 29, 2010 1:25 am

All good now!

Thank you
fotakis
 
Posts: 7
Joined: Wed Oct 10, 2007 4:35 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 68 guests