WebSplitButton issues

Discuss here any questions about the WebLaF library.
Bugs can be posted directly to GitHub issues tracker.

WebSplitButton issues

Postby debugger » Thu Sep 11, 2014 9:32 pm

I was using WebSplitButton and find out that after maximizing the window(WebFrame) the pressed WebSplitButton is not showing WebPopupMenu anymore. I don't know If its bug or not but I fixed it with using a simple ActionListener.
debugger
 
Posts: 3
Joined: Sun Aug 31, 2014 8:30 pm

Re: WebSplitButton issues

Postby mgarin » Fri Sep 12, 2014 3:19 pm

Could you provide a small code example representing this issue?
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg

Re: WebSplitButton issues

Postby debugger » Sun Sep 14, 2014 3:32 pm

ImageIcon addNewIcon = new ImageIcon("img/plus.png");
splitButtonAdd = new WebSplitButton ("Add...", addNewIcon);

//add Pop-Down Menu to Add New Button
popupMenuAdd = new WebPopupMenu ();
................
popupMenuAdd.add(popupMenuItemB);

popupMenuAdd.addSeparator();
...................
popupMenuAdd.add(popupMenuItemC);

popupMenuAdd.addSeparator();

splitButtonAdd.setPopupMenu(popupMenuAdd);


Pane Layout is set to BorderLayout.

Regards!
debugger
 
Posts: 3
Joined: Sun Aug 31, 2014 8:30 pm

Re: WebSplitButton issues

Postby mgarin » Mon Sep 15, 2014 10:51 am

I have tried this example:
Code: Select all
public class SplitButtonTest
{
    public static void main ( final String[] args )
    {
        WebLookAndFeel.install ();

        final WebSplitButton splitButtonAdd = new WebSplitButton ( "Add...", WebLookAndFeel.getIcon ( 16 ) );

        final WebPopupMenu popupMenuAdd = new WebPopupMenu ();
        popupMenuAdd.add ( new WebMenuItem ( "Test1" ) );
        popupMenuAdd.addSeparator ();
        popupMenuAdd.add ( new WebMenuItem ( "Test2" ) );
        popupMenuAdd.addSeparator ();
        popupMenuAdd.add ( new WebMenuItem ( "Test3" ) );
        splitButtonAdd.setPopupMenu ( popupMenuAdd );

        TestFrame.show ( splitButtonAdd );
    }
}

And it works fine with maximized frame. Menu is showing, but it simply doesn't have enough space on the screen to fit in. Though that isn't an issue since there is actually not enough space for menu.

You can also try this example:
Code: Select all
public class SplitButtonTest
{
    public static void main ( final String[] args )
    {
        WebLookAndFeel.install ();

        final WebSplitButton splitButtonAdd = new WebSplitButton ( "Add...", WebLookAndFeel.getIcon ( 16 ) );

        final WebPopupMenu popupMenuAdd = new WebPopupMenu ();
        popupMenuAdd.add ( new WebMenuItem ( "Test1" ) );
        popupMenuAdd.addSeparator ();
        popupMenuAdd.add ( new WebMenuItem ( "Test2" ) );
        popupMenuAdd.addSeparator ();
        popupMenuAdd.add ( new WebMenuItem ( "Test3" ) );
        splitButtonAdd.setPopupMenu ( popupMenuAdd );

        TestFrame.show ( splitButtonAdd, 150 );
    }
}

In this example menu fits properly onto the screen when frame is maximized.

But in any case - menu is properly displayed.
So I cannot actually reproduce the issue you have described.

You might either have some other code that affects this button behavior or misunderstanding how this button works (menu appears only when you click on the arrow button, not on the whole button).
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg

Re: WebSplitButton issues

Postby mgarin » Tue Sep 30, 2014 12:18 pm

Any news on this one?
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg


Return to Questions

Who is online

Users browsing this forum: No registered users and 2 guests

cron