Jide Split Button does not show a border

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.

Jide Split Button does not show a border

Postby Maurice » Thu Feb 02, 2012 3:46 am

Hi,

I am having an annoying problem whereby my JideSplitButton will not display its border unless I am hovering over it.

Any help would be great as it looks completely out of place next to my other button which do display their border.

Many Thanks.

Code: Select all
import javax.swing.*;
import com.jidesoft.swing.JideButton;
import com.jidesoft.swing.JideSplitButton;
import java.awt.*;

public class JideSplitButtonBorderTest extends JFrame {
   
   public JideSplitButtonBorderTest() {
      
      JPanel buttonPanel = new JPanel();
      JideSplitButton comp = new JideSplitButton("JideSplitButton");
      JideButton comp2 = new JideButton("JideButton");
      comp.setBorder(BorderFactory.createEtchedBorder());
      comp2.setBorder(BorderFactory.createEtchedBorder());
      buttonPanel.add(comp);
      buttonPanel.add(comp2);
      
      getContentPane().add(buttonPanel, BorderLayout.CENTER);
      
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      pack();
      setVisible(true);
      
   }
   
   public static void main(String[] args) {
      
      new JideSplitButtonBorderTest();
   }
}
Maurice
 
Posts: 62
Joined: Tue Sep 14, 2010 3:36 am

Re: Jide Split Button does not show a border

Postby JIDE Support » Thu Feb 02, 2012 3:21 pm

Please invoke comp.setBorderPainted(true) to paint the border.

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

Re: Jide Split Button does not show a border

Postby Maurice » Fri Feb 03, 2012 1:03 am

Thanks for that, however I still have a strange problem. I am trying to align the text in button to the center but comp.setHorizontalTextPosition(SwingConstants.CENTER); doesn't do anything?

Many thanks
Maurice
 
Posts: 62
Joined: Tue Sep 14, 2010 3:36 am

Re: Jide Split Button does not show a border

Postby JIDE Support » Fri Feb 03, 2012 9:23 am

Please use button.setHorizontalAlignment(SwingConstants.CENTER) instead.

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

Re: Jide Split Button does not show a border

Postby Maurice » Wed Feb 08, 2012 6:31 am

Thanks
Maurice
 
Posts: 62
Joined: Tue Sep 14, 2010 3:36 am


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

Who is online

Users browsing this forum: Google [Bot] and 6 guests

cron