web analytics

Contacts

Hi there!
My name is Mikle and I both develop and support WebLaF library and this site.

There are various ways you can contact me:
Project chat: Gitter
E-mail: mgarin@alee.com
Skype: Solondes
ICQ: 346513698
Facebook: Mikle Garin
Twitter: miklegarin
Habrahabr: mgarin

If you will be contacting me through Skype or ICQ – make sure to mention WebLaF in the add request or the first message.

Contact me at any time you like, I will do my best to answer in shortest possible period of time.

115 Comments

  1. Gliby
    Oct 09, 2013 @ 18:04:51

    Hi, I am creating a modeler viewer for java, and I really like Web Look And Feel, it’s like Twitter Bootstrap but for java. There is one problem though, whenever I apply the decoration to my Frame, the canvas stops working, it just becomes white. I

    Reply

    • Mikle
      Oct 09, 2013 @ 19:02:05

      You mean java.awt.Canvas? It might indeed have some problems (different problems on different enviroment – JDK/OS) with painting on non-opaque window due to its AWT “roots”. Unluckily i cannot do anything about it.

      But i can recommend you to switch to JComponent instead of Canvas – you will automatically get double buffering for your paintings and also will get rid of all bugs with painting Canvas have. Canvas is actually an outdated component and is only offered for use in some old Java-guides and examples.

      Here is an example of how can Canvas be replaced with JComponent:

      public class PaintingTest
      {
          public static void main ( String[] args )
          {
              WebLookAndFeel.install ();
              WebLookAndFeel.setDecorateAllWindows ( true );
      
              // JComponent example
              TestFrame.show ( new MyComponent (), 5 );
      
              // Canvas example
              TestFrame.show ( new MyCanvas (), 5 );
          }
      
          public static class MyCanvas extends Canvas
          {
              @Override
              public void paint ( Graphics g )
              {
                  super.paint ( g );
      
                  g.setColor ( Color.WHITE );
                  g.fillRect ( 0, 0, getWidth (), getHeight () );
                  g.setColor ( Color.BLACK );
                  g.drawLine ( 0, 0, getWidth (), getHeight () );
                  g.drawLine ( 0, getHeight (), getWidth (), 0 );
              }
      
              @Override
              public Dimension getPreferredSize ()
              {
                  return new Dimension ( 200, 200 );
              }
          }
      
          public static class MyComponent extends JComponent
          {
              public MyComponent ()
              {
                  super ();
      
                  // Set to true if you are filling all pixels of component rect
                  // This mark is basically used for painting optimizations
                  setOpaque ( true );
              }
      
              @Override
              protected void paintComponent ( Graphics g )
              {
                  super.paintComponent ( g );
      
                  g.setColor ( Color.WHITE );
                  g.fillRect ( 0, 0, getWidth (), getHeight () );
                  g.setColor ( Color.BLACK );
                  g.drawLine ( 0, 0, getWidth (), getHeight () );
                  g.drawLine ( 0, getHeight (), getWidth (), 0 );
              }
      
              @Override
              public Dimension getPreferredSize ()
              {
                  return new Dimension ( 200, 200 );
              }
          }
      }

      Basically you get everything Canvas have plus some additional methods JComponent have. And you won’t have any painting issues on non-opaque native windows (which are used for custom WebLaF decoration).

      Reply

  2. Ivan Greguric Ortolan
    Oct 07, 2013 @ 00:18:27

    Truly amazing LAF, good work!

    Reply

  3. Nikita
    Aug 15, 2013 @ 17:23:13

    Такой вопрос. Использую прикольную штуку под названием WebCollapsiblePane.
    И нужно сделать, чтобы фрейм подгонял свои размеры автоматом после скрытия или раскрытия панельки. Засунув вызов pack() в методы соответствующего слушателя, получил неприятный глюк анимации. Внутри находится просто таблица, и получается что при раскрытии все ее строки быстро мерцают на месте заголовка WebCollapsiblePane. Можно ли как-то уйти от этой особенности с таблицами?
    Ниже скрин с последовательностью нажиманий.
    http://a0.sderni.ru/d/259599/temp.png

    Reply

    • Mikle
      Aug 15, 2013 @ 17:32:07

      Попробовал воспроизвести ситуацию:

          public static void main ( String[] args )
          {
              WebLookAndFeel.install ();
      
              final String[] columns = { "1", "2", "3" };
              final String[][] data = { { "1", "2", "3" }, { "1", "2", "3" }, { "1", "2", "3" } };
              final WebTable table = new WebTable ( data, columns );
              final WebScrollPane scrollPane = new WebScrollPane ( table );
              final WebCollapsiblePane pane = new WebCollapsiblePane ( "Title", scrollPane );
              final TestFrame testFrame = TestFrame.show ( pane, 5 );
              pane.addCollapsiblePaneListener ( new CollapsiblePaneAdapter ()
              {
                  public void expanded ( WebCollapsiblePane pane )
                  {
                      testFrame.pack ();
                  }
      
                  public void collapsed ( WebCollapsiblePane pane )
                  {
                      testFrame.pack ();
                  }
              } );
          }

      Всё вполне нормально отрабатывает, никаких мерцаний.
      Возможно есть какие-то особенности настройки компонентов или же пакования фрейма?

      В идеале хотелось бы увидеть небольшой пример в виде кода, в котором воспроизводится проблема.

      Reply

  4. Tsamis
    Apr 22, 2013 @ 18:47:40

    One simple question… In the WebFileDrop the setSelectedFiles(…) method is supposed to open some files in the WebFileDrop? In this case it doesn’t work for me. Maybe i’am doing some mistakes… thanks in advance

    Reply

    • Mikle
      Apr 23, 2013 @ 00:48:58

      It should add specified files as plates inside the file drop component. If it doesn’t – obviously it is a bug :)

      I will look into it and fix it if there is actually a bug.

      Reply

      • Tsamis
        Apr 23, 2013 @ 13:24:17

        Thank you

        Reply

  5. Sairam
    Feb 19, 2013 @ 13:56:58

    it’s better to give small example program which inherited all the above features…
    it’s useful to all swings lovers ….

    Reply

    • Mikle
      Feb 19, 2013 @ 14:07:35

      There is a big demo application available in downloads section and you can also see it on this page on the right side at the top (“Demo” link with WebLaF icon). This demo contains almost all visual features WebLaF offers and example source codes.

      Reply

      • Sairam
        Feb 20, 2013 @ 09:34:11

        ya actually i download it and saw all the effects, but i can’t able(understand),
        how to use those effects to my swing application .

        Reply

        • Mikle
          Feb 20, 2013 @ 11:01:07

          Depends on what you need to do. You can also look at example source code right in the demo app – in simple cases it should be enugh to understand how ComponentTransition works 😉

          Reply

  6. Ayush Agrawal
    Jan 24, 2013 @ 08:00:45

    HI. I am new to Swing and i love this look and feel. I checked out the demo that is available for download. I saw the tooltip and also checked out its source. But i cannot figure out how to add it to my program. When I copy the thing (WebLabel tip = new …..), it says that it cannot find loadIcon method. So i added the example as source and added the import but i still could not use it.
    Can you help me out? I am using NetBeans!

    Reply

    • Endogen
      Feb 18, 2013 @ 22:49:10

      Try this: Every object that you create and that is also available in WebLAF should be created from the WebLAF classes. That means: If you have a JFrame that you are displaying or maybe a JPanel, then try to use the WebLAF classes for them: WebFrame & WebPanel…

      Reply

      • Mikle
        Feb 19, 2013 @ 14:04:30

        Its not really necessary to use Web-components – you can stick to J-components as usual, unless you want to access some extended styling features without pulling out the Web-UI classes and accessing their methods directly :)

        And even more – you can use Web-components without installing WebLaF as application Look and Feel. That might be useful if you want to use some of the components and features, but not the L&F itself. Yet in this case there might be some styling problems in complex components (like tabbed pane), but i will certainly fix them in future updates.

        Reply

    • Mikle
      Feb 19, 2013 @ 14:00:09

      Sorry, somehow i missed your comment :(

      Could you please post the exact code sample that doesn’t work/launch properly? And what exception do you recieve when you are trying to launch your application?

      It is really hard to figure out the problem without seeing the exact code and error.

      Reply

  7. David
    Jan 16, 2013 @ 19:55:10

    I don’t really know what to say… Maybe WOW? :) This LAF is great! I just found it while searching for a nice clean LAF that looks similar to BizLaf (http://www.centigrade.de/en/products/bizlaf-stock-look-and-feel).

    Well, i guess i just found it 😀 !! Just wanted to say that i really appreciate your hard work.

    Cheers

    Reply

    • Mikle
      Jan 16, 2013 @ 20:05:12

      Thanks! :)

      Reply

      • David
        Jan 18, 2013 @ 14:28:23

        BTW: If i use the “path field” in the demo and choose, lets say, ‘WINDOWS’ and then click on the arrow, i see all the folders under Windows. But they are to many and don’t fit the vertical screen size. The problem is i cant scroll them.
        Maybe you can add that :)

        Reply

        • Mikle
          Jan 18, 2013 @ 14:30:18

          No worries – that is a know bug and it will be fixed in next few version :)

          Reply

  8. Gleb
    Dec 25, 2012 @ 00:23:51

    Добрый день. Открыл для себя вашу замечательную библиотеку. Хотелось бы поинтересоваться: планируются ли какие либо разработки по части отображения графиков или осциллограмм, а то на первый взгляд не увидел. Спасибо.

    Reply

    • Mikle
      Dec 25, 2012 @ 17:10:31

      Пока-что по этой части наработок нет и пока не могу однозначно сказать будут ли. Дело в том что это достаточно обширная область (возможно даже более обширная нежели полная переработка интерфейса приложения и написание собственного L&F). Также имеются весьма неплохие проверенные и проработанные варианты в этой области, например JFreeChart (http://www.jfree.org/jfreechart/) – она, кстати говоря, доступна под LGPL лицензией.

      Reply

  9. Y
    Sep 26, 2012 @ 11:08:07

    There is a mistake in your NinePatchInterval

    public NinePatchInterval ( int start, boolean pixel )
    {
        this ( start, start, pixel );
    }

    Reply

    • Mikle
      Sep 26, 2012 @ 11:43:35

      This constructor is correct, but indeed there was a mistake in the next one:

      public NinePatchInterval ( int start, int end )
      {
          this ( start, start, true );
      }

      I fixed it, but its not used anywhere yet.
      Anyway thanks for pointing it out :)

      Reply

  10. hackereye
    Sep 16, 2012 @ 07:31:24

    I suggest that you add Maven Project support

    Reply

    • Mikle
      Sep 17, 2012 @ 13:33:26

      I might add it later, but for now finishing a stable 1.4 version is a top-priority task.

      Reply

  11. Nicolas Magré
    Aug 22, 2012 @ 08:03:00

    Hi,

    I really appreciate your job. Your LAF is so simple to use and wonderful, which is why i use it in my open source project.

    I had a lot of problems and I just needed a look at the sources to solve it.
    There is just one thing remaining, i don’t know how to use your tooltip on a “WebList” (one for all elements in).
    My “WebList” contains images or images plus some text (it is just a simple label).

    If someone have an idea to how use LAF tooltips in a list, it will be perfect.

    Thanks for your LAF.

    Reply

    • Mikle
      Aug 22, 2012 @ 11:27:33

      I will bring new tooltips (custom ones) into trees, tables and lists in next version. For now you can manage to add them onto those components but unluckly it won’t be so easy.

      You might want to use standard Swing tooltips for those components for now, since custom tooltips integration will be almost the same.

      Reply

  12. Markus
    May 10, 2012 @ 16:09:23

    Hi buddy, me again!

    Your LnF sadly messes up JFileChooser functionality …
    is there any way to override it? Or do you update it soon?

    Looking forward!
    Greetings,
    Markus

    Reply

    • Mikle
      May 10, 2012 @ 17:25:55

      Hi there :)
      Yes, JFileChooser UI is not implemented yet – only a separate chooser component/dialog. I am working on it and hopefully will include its UI in next version or two.

      New version got stuck a bit due to other projects in our company. Hopefully i will finish 1.4 soon and release a lot of new features, fixes and updates.

      Reply

      • Markus
        May 10, 2012 @ 23:29:48

        Sounds good! Dont forget that your LnF is one of the best yet even thought its not even finished.

        And i really hope its finished soon!

        For the meantime and my question, is there any way to override just the JFileChooser LnF functionality within some lines of code?

        Reply

        • Mikle
          May 11, 2012 @ 15:48:31

          Basically – you can use WebFileChooser or WebDirectoryChooser as a replacement for JFileChooser. It has lots of additional features and will be implemented as a JFileChooser UI pretty soon. I just need to fix a few things there and move it into the UI class.

          You can find all code examples in the demo app (it now has all source codes attached right in the visual demo – just click the source code button near any example). Look into the “File choosers” section of the demo app to see related examples :)

          Reply

  13. Markus
    Apr 29, 2012 @ 06:55:19

    Hi there!
    First i want to tell you, you do an awesome job.
    Im at the very begining of getting into java development.
    And after several hours of searching for useful GUI elements, i found the way of lookandfeel.

    On the site i’ve found it, your lookandfeel was also recommend, so i gave it a try.

    It even works as far for now, however im still getting an error/warning:
    AM jsyntaxpane.DefaultSyntaxKit loadConfig
    INFO: unable to load configuration for: class jsyntaxpane.DefaultSyntaxKit from: jsyntaxpane/DefaultSyntaxKit/config.properties

    The java documentation about this isnt really useful, also google didnt help me in any way. This error occurs only after i initiated your package by follow line:
    UIManager.setLookAndFeel(com.alee.laf.WebLookAndFeel.class.getCanonicalName());
    (as suggested in your documentary with try/catch). The jar package is also included in libs.

    How can i get rid of the error/warning message?

    Reply

    • Mikle
      Apr 29, 2012 @ 13:06:43

      Thanks for the kind words :)

      And about the warning – it is generated by JSyntaxPane in which source code shown in demo application (for the proper highlights and such). In next update it will be removed from the actual library (WebLookAndFeel.jar) and will be included only in demo jar since its not used anywhere in WebLaF core.

      Next update will be coming in next 2-3 weeks with a lot of new features and fixes :)

      Reply

      • Markus
        Apr 29, 2012 @ 18:22:31

        Thank you for your really fast reply!
        Im looking forward to your next release, it will be a part of my every project from now on!

        But one for thing i just have to ask for.
        Could you implement an kind of explicit usage, such as to define (and style) components in the application? I would like to chose some colours and stuff by myself sometimes (but not really often).
        Thats it already!

        Thank you for your fantastic work!

        Reply

        • Mikle
          Apr 30, 2012 @ 03:50:29

          There are a lot of ways to re-style default WebLookAndFeel view:
          1. You can redefine static constants inside style classes (for e.g. in WebButtonStyle.class or WebPanelStyle.class) to affect every component of that type in the whole application.
          2. You can redefine those styles in each specific component by calling methods like “setShadeWidth”, “setRound” or “setTopBgColor” and others.
          3. You can define BackgroundPainter to fully change component’s view to something else (you will have to paint it using Graphics2D though).
          4. You can use some nine-patch “textures” to style components through NinePatchBackgroundPainter and StateBackgroundPainter painters.

          Reply

          • Markus
            Apr 30, 2012 @ 07:06:03

            Thank you for your replay again!

            Im a very beginner yet, just got close to UIManager itself since the default swing components are not really “my style”.

            I will try to do as you suggest me, but for now i need to sleep. Aiming for setting background images as selected bkg on JMenuBar objects hah! Good night!

            Reply

  14. Jorj Daniel
    Apr 05, 2012 @ 21:19:47

    There’s no documentation ?
    Even javadoc ?

    Reply

    • Mikle
      Apr 05, 2012 @ 22:55:02

      Unfortunately – no. I am looking forward to add atleast basic Javadoc when i will finish with the stable release.

      There is a demo-application though, that has almost all possible examples and their source codes. Plus all the source code has lots of comments which helps to understand any method or class functionality.

      Reply

  15. Abu Abdullah
    Mar 29, 2012 @ 12:25:33

    Thanks for this L&F. My applications are RTL and there are few issues e.g.

    – JMenu, JMenuItem are always LTR
    http://i39.tinypic.com/wk62xk.png

    – FlowLayout always LTR
    – JPanel size is not filling the whole area.
    http://i39.tinypic.com/qxqie1.png

    – JFileChooser is not shown at all
    – JTree needs adjustment
    http://i43.tinypic.com/ae6545.png

    – jide CheckBoxTree highlighted background is not shown
    http://i42.tinypic.com/2hrmvbb.png

    – JList is still LTR
    http://i40.tinypic.com/ily3gx.png

    – overriding default font is not working on these:
    UIManager.put(“Button.font”, new FontUIResource ( …) );
    UIManager.put(“Panel.font”, new FontUIResource ( …) );
    UIManager.put(“TabbedPane.font”, new FontUIResource ( …) );
    and many others.

    – jprogressbar with RTL text is not aligned correctly
    http://i39.tinypic.com/24lkay9.png

    These what i got from the first glance. I would suggest to have RTL button in the WebLookAndFeel_demo.jar so that you can see most of the issues at once.

    Reply

    • Mikle
      Mar 29, 2012 @ 12:52:55

      – JMenu, JMenuItem are always LTR
      – JFileChooser is not shown at all
      – JTree needs adjustment
      – JProgressbar with RTL text is not aligned correctly

      Yes indeed these problems are presented. I will try to fix all of them in the closest update. It’s just that not so many people asked about RTL support/bugs so i postponed some of the changes. Now i will pull them back and fix alltogether.

      – FlowLayout always LTR

      Not sure if this is connected to current Look and Feel installed – will check it to be sure.

      – JPanel size is not filling the whole area.

      Did not really get what you mean here (and if the screenshot is connected to this issue)

      – jide CheckBoxTree highlighted background is not shown

      This happens due to opacity mark of the tree cell renderer set to “true”. Since this highlight is drawn on the tree itself and not on the cells it “lies” below the renderers and ofcourse appears partually hidden if the renderer is opaque. To fix it simply modify the jide renderer (the one with checkbox inside) and use setOpaque(false) on it (though not sure if it could be easily changed since Jide checkbox renderers are hidden as i remember).

      – JList is still LTR

      Already fixed this in default list renderer – now it properly aligns text and icon.

      – overriding default font is not working on these:
      – UIManager.put(“Button.font”, new FontUIResource ( …) );
      – UIManager.put(“Panel.font”, new FontUIResource ( …) );
      – UIManager.put(“TabbedPane.font”, new FontUIResource ( …) );
      – and many others.

      You are trying to assign those before installing the Look and Feel or after?

      – These what i got from the first glance. I would suggest to have RTL button in the WebLookAndFeel_demo.jar so that you can see most of the issues at once.

      If there won’t be any problems with RTL orientation (after some fixes, ofcourse) i will add it into demo in next library update.

      P.S. Thanks for the feedback and i hope you like the library and UI’s!

      Reply

      • Abu Abdullah
        Mar 29, 2012 @ 13:53:42

        Thanks for your prompt response.

        Did not really get what you mean here (and if the screenshot is connected to this issue)
        This is what it looks like using metal L&F:
        http://i40.tinypic.com/bhzlfn.png

        The border of JPanel is filling the whole area. Also you will see FlowLayout LTR in the same pic in the buttons area.

        Already fixed this in default list renderer – now it properly aligns text and icon.
        I have used v1.3, is there a newer version.

        You are trying to assign those before installing the Look and Feel or after?
        before. you can see it in the same pictures:

        using java default font
        http://i39.tinypic.com/qxqie1.png

        using Tahoma font:
        http://i40.tinypic.com/bhzlfn.png

        Many thanks again.

        Reply

        • Abu Abdullah
          Mar 29, 2012 @ 13:56:39

          Maybe I was mistaken with the fonts. It seems the rendering is a bit different

          Reply

          • Mikle
            Mar 29, 2012 @ 14:15:47

            Yeah, seems they are actually different :)

            Reply

        • Mikle
          Mar 29, 2012 @ 14:15:02

          – Thanks for your prompt response.

          Anytime :)

          – The border of JPanel is filling the whole area. Also you will see FlowLayout LTR in the same pic in the buttons area.

          That is pretty strange, since as i know FlowLayout doesn’t act like that (shouldn’t fill the area) and that could be confirmed on any famous Look and Feel (seems except Metal). I already checked the sources of the JDK and not sure that anything so dramatically affects FlowLayout behavior…

          In your case (3 panels aligned one after another) i would use VerticalFlowLayout – it allows you to align any components one after another vertically with some gap and stretching components to container width.

          By the way – you can also find VerticalFlowLayout inside WebLookAndFeel library.

          – I have used v1.3, is there a newer version.

          Sorry, i made a small mistake – “Already fixed this in default list renderer – now it properly aligns text and icon.” – i meant that i just applied that fix to code and it will be available in next update :)

          – before. you can see it in the same pictures:

          That’s a mistake – you should apply those styles after installing Look and Feel, since it passes its own styles to UIManager and ofcourse might replace yours. Order is really important when working with Swing interface :)

          Reply

          • Abu Abdullah
            Mar 29, 2012 @ 14:38:11

            That is pretty strange, since as i know FlowLayout doesn’t act like that (shouldn’t fill the area) and that could be confirmed on any famous Look and Feel (seems except Metal). I already checked the sources of the JDK and not sure that anything so dramatically affects FlowLayout behavior…

            In your case (3 panels aligned one after another) i would use VerticalFlowLayout – it allows you to align any components one after another vertically with some gap and stretching components to container width.

            Sorry I was not clear. There are two different points:

            – JPanel are placed with BoxLayout.Y_AXIS. The borders are just not stretch enough to fill the rest of the area.

            – For the FlowLayout, you can see it with the JButton Layout:

            http://i40.tinypic.com/bhzlfn.png
            http://i39.tinypic.com/qxqie1.png

            All the three JButton are in JPanel(new BorderLayout())
            – The two left JButton are in one JPanel() residing at WEST
            – The right JButton is in JPanel() residing at EAST

            In Metal it seems it is layout in the correct positions but for the second picture you will see all of them are placed in the center.

            this is the code:


            final JPanel choicePanel = new JPanel();
            choicePanel.add(okButton);
            choicePanel.add(cancelButton);

            southPanel.add(choicePanel, BorderLayout.WEST);

            final JPanel decoratePanel = new JPanel();
            decoratePanel.add(helpButton);
            southPanel.add(decoratePanel, BorderLayout.EAST);

            Thanks for the other comments, I will try to recheck my applications after applying them.

            Reply

            • Mikle
              Mar 29, 2012 @ 15:39:24

              Now i got it :)

              Well now i see the problem – both south panels (with one and two buttons) has FlowLayout right? And with RTL orientation they are still not aligned to sides as they are with Metal LaF.

              I will check on the orientation settings now and see how exactly it affects FlowLayout.

              Reply

            • Mikle
              Mar 29, 2012 @ 15:47:09

              And about your south panel – i tried this code:

                      new TestFrame ( new JPanel ()
                      {
                          {
                              setLayout ( new BorderLayout () );
              
                              JPanel left = new JPanel ();
                              left.add ( new JButton ( "One" ) );
                              left.add ( new JButton ( "Two" ) );
                              add ( left, BorderLayout.WEST );
              
                              JPanel right = new JPanel ();
                              right.add ( new JButton ( "three" ) );
                              add ( right, BorderLayout.EAST );
                          }
                      } );

              And this is what i got from it:
              http://smotr.im/4eXU

              Works just fine – are you sure your JPanels (those which holds buttons) has the FlowLayout by default and that they lie exactly in BorderLayout-ed container?

              Seems that something is wrong there…

              Reply

    • Mikle
      Mar 30, 2012 @ 12:48:05

      By the way, i almost forgot – JFileChooser UI is not added yet – it will b moved from extended component into UI in future releases.

      So far you can use WebFileChooser & WebFileChooserPanel as a replacement. They contain extended JFileChooser functionality.

      Reply

    • Mikle
      Mar 30, 2012 @ 16:22:42

      One more thing – i will fix all the bugs you have posted and will also add RTL support into each styled Swing-component and library custom component aswell. This won’t take long but might be very useful for everyone who uses RTL layout.

      I think those changes will take about a week (including library “deploy”). So you will get them pretty soon with lots of other critical changes and improves inside the library :)

      Reply

      • Abu Abdullah
        Apr 02, 2012 @ 11:09:50

        many thanks.

        in the demo filechoose, creating New folder will not show you the new folder unless you refresh or pass the mouse over the files.

        Reply

        • Mikle
          Apr 02, 2012 @ 11:44:56

          Yes, there are a few bugs and incompleted features in WebFileChooser i am working on right now – those fixes will also be in 1.4 version.

          By the way – 1.4 will be the first stable library version.

          Reply

  16. anna
    Dec 01, 2011 @ 02:46:31

    Hello. I’m interested to see the look-and-feel in action. Unfortunately the web launcher doesn’t work on OS X, and also the demo.jar fails with this exception (OS X 10.6 / java 1.6):


    Exception in thread "main" java.lang.NoSuchFieldError: BASICMENUITEMUI_MAX_TEXT_OFFSET
    at com.alee.laf.menu.MenuItemLayoutHelper.calcMaxTextOffset(MenuItemLayoutHelper.java:493)
    at com.alee.laf.menu.MenuItemLayoutHelper.reset(MenuItemLayoutHelper.java:147)
    at com.alee.laf.menu.MenuItemLayoutHelper.(MenuItemLayoutHelper.java:101)
    at com.alee.laf.menu.WebMenuUI.getPreferredMenuItemSize(WebMenuUI.java:91)
    at javax.swing.plaf.basic.BasicMenuItemUI.getPreferredSize(BasicMenuItemUI.java:363)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
    at javax.swing.BoxLayout.checkRequests(BoxLayout.java:464)
    at javax.swing.BoxLayout.preferredLayoutSize(BoxLayout.java:281)
    at javax.swing.plaf.basic.DefaultMenuLayout.preferredLayoutSize(DefaultMenuLayout.java:49)
    at java.awt.Container.preferredSize(Container.java:1599)
    at java.awt.Container.getPreferredSize(Container.java:1584)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1636)
    at javax.swing.JRootPane$RootLayout.preferredLayoutSize(JRootPane.java:912)
    at java.awt.Container.preferredSize(Container.java:1599)
    at java.awt.Container.getPreferredSize(Container.java:1584)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1636)
    at javax.swing.plaf.basic.BasicInternalFrameUI$Handler.preferredLayoutSize(BasicInternalFrameUI.java:1272)
    at javax.swing.plaf.basic.BasicInternalFrameUI.getPreferredSize(BasicInternalFrameUI.java:325)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
    at javax.swing.JInternalFrame.pack(JInternalFrame.java:1692)
    at com.alee.examples.WebLookAndFeelExample.createDesktopPaneExample(WebLookAndFeelExample.java:3102)
    at com.alee.examples.WebLookAndFeelExample.getAllExamplesPanel(WebLookAndFeelExample.java:1899)
    at com.alee.examples.WebLookAndFeelExample.(WebLookAndFeelExample.java:262)
    at com.alee.examples.WebLookAndFeelExample.main(WebLookAndFeelExample.java:3255)

    Reply

    • Mikle
      Dec 01, 2011 @ 10:49:27

      This error appeared in older Java versions on any OS.
      It seems you have some old unupdated JVM on Mac OS, since i tried on my own mac with Snow Leopard and it was working properly.

      Though in next version i’ll change the code a bit, so this error won’t show up even on older JVM versions.

      Reply

    • Abu Abdullah
      Mar 30, 2012 @ 06:19:22

      Please find the below code which generate the problem.

      import javax.swing.*;
      import java.awt.*;
      
      class TestFrame 
      {
      	public static void main(String[] args)
      	{
      		try{UIManager.setLookAndFeel(com.alee.laf.WebLookAndFeel.class.getCanonicalName());}
      		catch(Throwable e){}
      		
      		JFrame f = new JFrame()
      		{
      			{
      				setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
      				
      				final JPanel southPanel = new JPanel(new BorderLayout ());
      				add(southPanel);
      				
      				JPanel left = new JPanel ();
      				left.add ( new JButton ( "One" ) );
      				left.add ( new JButton ( "Two" ) );
      				southPanel.add ( left, BorderLayout.WEST );
      		 
      				JPanel right = new JPanel ();
      				right.add ( new JButton ( "three" ) );
      				southPanel.add ( right, BorderLayout.EAST );
      				
      				setSize(500, 100);
      				setVisible(true);
      			}
      		};
      	}
      }
      

      I think now it has something to do with the BoxLayout.Y_AXIS. It is the same issue of the JPanel is not filling the whole area, that’s why all buttons in the middle

      Reply

      • Mikle
        Mar 30, 2012 @ 11:34:51

        Thanks for the example! Now i can clearly say that BoxLayout causes such behavior.

        It took some effort but i found a cause (and a solution) for this strange BoxLayout behavior…

        At first, i didn’t find any tips in code but after checking some of the official tutorials on BoxLayout i have noticed, that it uses components getMaximumSize method which is requested directly from the UI of the component. And i did not assign anything special for this – just a simple getPreferredSize (it is the actual default behavior for the “null” LaF).

        So i changed the code in WebPanelUI for getMaximumSize:

            public Dimension getMaximumSize ( JComponent c )
            {
                return new Dimension ( Integer.MAX_VALUE,Integer.MAX_VALUE );
            }

        With this it works the same way it does with other LaF’s.

        The thing is that BoxLayout uses getMaximumSize of the component to determine component width inside the layout and it doesn’t let the component take more than getMaximumSize returns. And in case it returns the same thing as the getPreferredSize – component gets “compressed” into the preferred size.

        I will add this fix to all of the UI’s to make them scaleable in different Swing layouts. This fix will be available in the next update :)

        Reply

  17. Анна
    Nov 14, 2011 @ 18:06:09

    WebFileChooser работает оооочень медленно. Можно ли как-то ускорить? JFileChooser не работает вообще – открывается пустая панелька. Можешь помочь?

    Reply

    • Mikle
      Nov 14, 2011 @ 22:44:45

      В ближайшей версии выйдет достаточно много фиксов на WebFileChooser, хотя и сейчас его производительность вполне нормальна.
      Он работает на порядок быстрее обычного JFileChooser’а засчёт корректного кэширования информации.
      Можете пояснить в чём конкретно проявляются тормоза?

      JFileChooser на данный момент не стилизован, поэтому его фактически и нет.
      В дальнешем в нём будет реализован упрощённый вариант WebFileChooser’а.

      Reply

      • Анна
        Nov 15, 2011 @ 15:47:02

        Спасибо за ответ. У меня WebFileChooser работает медленнее чем джейчусер (нимбус), чем больше файлов нужно отобразить тем дольше думает. Может это из-за иконок? Жду новых версий.
        Спасибо за ваш лаф, выглядит и работает просто отлично. Удачи.

        Reply

        • Mikle
          Nov 15, 2011 @ 16:11:06

          Вероятно на очень большой объёме одновременно просматриваемых изображений могут быть заметны тупняки (в связи с генерацией большого кол-ва превьюшек).

          Попробуйте запустить WebFileChooser с отключенным режимом генерации превью изображений (к сожалению без исходного кода в текущей версии этого не сделать – немного не доработал эту возможность).
          Если у Вас имеется исходный код – достаточно изменить в классе WebFileChooserPanel параметр “private boolean generateImagePreviews = true;” на false – он находится в глобальных переменных этого класса.
          Был бы признаетелен если бы Вы попробовали данный вариант и сказали – остались ли тормоза или же нет (соответственно будет более ясно куда копать насчёт производительности).

          Спасибо за ваш лаф, выглядит и работает просто отлично. Удачи.

          Спасибо за лестный отзыв :)
          Ещё очень много всего будет добавлено и улучшено – всё только начинается!

          Reply

  18. Василий
    Oct 10, 2011 @ 19:01:51

    Попытался запустить идею с WebLF, сыпит эксепшнами, многие табы настроек попросту не загружаются, колорпикер вызвать возможности нет. Куча нульпоинтеров и прочей радости.

    Но даже демка тормозит на феноме x4 3.200, между действием и отображением проходит порядка секунды, это совсем не дело.

    а еще в колорпикере хотелось бы скринпикер, его же просто реализовать через awt Robot, почему его нигде нет?
    Да, пытался использовать WebLF только ради колорпикера, но пришлось самому править GTKColorPicker чтобы достичь желаемой функциональности.

    Reply

    • Mikle
      Oct 10, 2011 @ 19:21:50

      Весьма странное поведение – нигде такого не видел – Вы первый кто говорит о подобной нестабильности. Вероятно Вы запускали под достаточно старой версией JVM или же под какой-то специфичной ОС?

      Со скринпикером есть несколько мелочей, мешающих простой реализации. Но в любом случае идея хорошая – постараюсь добавить в ближайших версиях.

      Reply

  19. Yuriy
    Sep 25, 2011 @ 20:46:34

    Вы не думали о добавлении артефактов проекта в Maven Central ?
    Это сильно могло бы увеличить количество разработчиков, использующих библиотеку :-)

    Reply

    • Mikle
      Sep 25, 2011 @ 22:44:07

      Уже думал и эту идею уже выдвигали.
      Вполне возможно через некоторое время займусь этим – как только доведу различные мелочи до ума и определюсь с расположением исходников :)

      Reply

  20. Pierre Piramidos
    Sep 01, 2011 @ 19:20:47

    Спасибо! Давно искал хорошую обертку/замену глазовыковыривательненькому swing.
    Есть замечание по сайту. Не понравилось то, что когда жмешь “Download”, браузер открывает либу как страницу в отдельном окне, а не запихивает его себе в даунлоады.

    Reply

    • Mikle
      Sep 01, 2011 @ 19:22:22

      Да, действительно был такой косяк. Поправил – теперь файлы корректно скачиваются, а не открываются в браузере.

      Reply

Leave a Reply

*