tag:blogger.com,1999:blog-6885067460687713893.post7350173775186410176..comments2024-03-28T05:50:40.310+01:00Comments on Harmonic Code: Friday Fun Component IIIHan Solohttp://www.blogger.com/profile/12574196875988408685noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-6885067460687713893.post-42893433639896998022018-01-19T08:42:13.236+01:002018-01-19T08:42:13.236+01:00Aloha...can you give it another try?Aloha...can you give it another try?Han Solohttps://www.blogger.com/profile/12574196875988408685noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-31694692157962640692018-01-19T08:32:58.089+01:002018-01-19T08:32:58.089+01:00Can you update links ? Cannot download , file not ...Can you update links ? Cannot download , file not foundBXOhttps://www.blogger.com/profile/08674030328976178883noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-34960142577246716182015-12-10T12:29:42.845+01:002015-12-10T12:29:42.845+01:00hi vince,
i am having the same problem. can u sen...hi vince,<br /><br />i am having the same problem. can u send the link for how did you get that layout manager problem solved.<br /><br />Best Regards,<br />SanketAnonymoushttps://www.blogger.com/profile/09145912976103853440noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-52469305752879911682014-12-07T11:49:22.092+01:002014-12-07T11:49:22.092+01:00Thank U!!! this button is wonderful
I love it!Thank U!!! this button is wonderful<br /><br />I love it!Anonymoushttps://www.blogger.com/profile/00194653112262193938noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-49811402357812767192012-12-15T01:14:00.878+01:002012-12-15T01:14:00.878+01:00Me again :-).
I added the "vertical" fea...Me again :-).<br />I added the "vertical" feature via a new Constructor (with a SwingConstants.VERTICAL parameter). Here is the code if you're interested:<br />https://www.yousendit.com/download/WUJaZGluTkFqY29QWWNUQw<br />Feel free to delete this post when you have downloaded the file. The yousendit link will expire soon...<br />Best regards,<br />Vicne<br />Vincenthttps://www.blogger.com/profile/14415552273523942681noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-16165078324724813502012-12-14T18:28:56.145+01:002012-12-14T18:28:56.145+01:00OK. I guess that was due to a typo: at SteelCheckB...OK. I guess that was due to a typo: at SteelCheckBoxUI:81, getPreferredSize() should really be getSize(). <br /><br />VicneVincenthttps://www.blogger.com/profile/14415552273523942681noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-42700077793151318202012-12-14T18:13:46.264+01:002012-12-14T18:13:46.264+01:00This comment has been removed by the author.Vincenthttps://www.blogger.com/profile/14415552273523942681noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-48057599639199308962012-12-14T17:40:34.148+01:002012-12-14T17:40:34.148+01:00Great, thanks :-)
Btw, I just noticed an issue if...Great, thanks :-)<br /><br />Btw, I just noticed an issue if the layout manager does not honor the preferred size of the component: the text and foreground are centered based on the actual size of the component while the background and knob are always at the top left of the provided space. See this screenshot where it's in a GridLayout next to a 100x100 button: http://screencast.com/t/leiSxqk0<br /><br />Probably recomputing elements upon resize would be the cleanest solution. I'm having a look right now, then I'll tackle the orientation question. I'll let you know if I succeed ;-).<br /><br />Best regards,<br /><br />VicneVincenthttps://www.blogger.com/profile/14415552273523942681noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-20886275568341380752012-12-14T14:35:11.887+01:002012-12-14T14:35:11.887+01:00Hi Vicne,
Thanx for the hint, will fix the code wh...Hi Vicne,<br />Thanx for the hint, will fix the code which is btw under BSD so feel free to use it for whatever you like.<br />Cheers,<br />GerritHan Solohttps://www.blogger.com/profile/12574196875988408685noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-50190501834349240762012-12-14T14:24:41.834+01:002012-12-14T14:24:41.834+01:00By the way, what are the licensing terms for your ...By the way, what are the licensing terms for your code. I would like to use that component in an Open-Source project and even modify it slightly (make the switch optionally vertical). Is that OK ?Vincenthttps://www.blogger.com/profile/14415552273523942681noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-15343291021863138042012-12-14T14:15:00.812+01:002012-12-14T14:15:00.812+01:00Hi Han,
Congrats for this component, and thanks fo...Hi Han,<br />Congrats for this component, and thanks for sharing it.<br />Just wanted to point out that my first test got into an Exception I traced back: your component requires a (non null, non empty) text to be set. If you don't call setText() with a non-empty String before displaying the component, you're getting an IllegalArgumentException: "Zero length string passed to TextLayout constructor." (see exact stack trace below).<br /><br />I fixed the source by enclosing the lines SteelCheckBoxUI:152-157 in a "if (CHECKBOX.getText() != null && CHECKBOX.getText().length() > 0) {...}" test.<br /><br />Maybe you can change it in the distributed code. Otherwise maybe it can help others.<br /><br />Best regards (and thanks again)<br /><br />Vicne<br /><br />Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Zero length string passed to TextLayout constructor.<br /> at java.awt.font.TextLayout.(TextLayout.java:382)<br /> at eu.hansolo.custom.SteelCheckBoxUI.paint(SteelCheckBoxUI.java:155)<br /> at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)<br /> at javax.swing.JComponent.paintComponent(JComponent.java:778)Vincenthttps://www.blogger.com/profile/14415552273523942681noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-30985254765648797152012-09-04T08:56:10.741+02:002012-09-04T08:56:10.741+02:00Hi there,
Sorry for this, but I had to move from ...Hi there,<br /><br />Sorry for this, but I had to move from iDisk to DropBox which means many links doesn't work anymore, please let me know if you encounter other broken links and I will fix them.<br />This one here should now work again...<br />Cheers,<br />GerritHan Solohttps://www.blogger.com/profile/12574196875988408685noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-80932773857178391442012-09-04T08:16:17.974+02:002012-09-04T08:16:17.974+02:00the link for download is not working now....can an...the link for download is not working now....can anyone mail the src at nikunj91@gmail.comnaughty fellowhttps://www.blogger.com/profile/14916553006480761785noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-1679626294168852162012-06-22T14:25:50.419+02:002012-06-22T14:25:50.419+02:00The knob itself is not resizeable but if you need ...The knob itself is not resizeable but if you need this functionality you should take a look into SteelCheckBoxUI.java where you will find the methods that create the images. So you should be able to modifiy the size related methods in the way that they will also work for the button etc.<br />Cheers, <br />GerritHan Solohttps://www.blogger.com/profile/12574196875988408685noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-3946487356908120992012-06-22T13:58:27.285+02:002012-06-22T13:58:27.285+02:00Only one word... "BEAUTIFUL"
Thanks. How...Only one word... "BEAUTIFUL"<br />Thanks. How can i stretch it to my required size?? In netbeans i'm able to do it only for text of the SteelCheckBox.Shashank Degloorkarhttps://www.blogger.com/profile/15806987149172395202noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-67841593165599242272010-11-08T16:35:07.708+01:002010-11-08T16:35:07.708+01:00Nice!Nice!Anonymoushttps://www.blogger.com/profile/18232587351469084767noreply@blogger.comtag:blogger.com,1999:blog-6885067460687713893.post-76490431402202796382010-11-05T14:31:34.531+01:002010-11-05T14:31:34.531+01:00The more simple things are often useful too.The more simple things are often useful too.Benjaminnoreply@blogger.com