Cannot Resize Form In NetBeans
Posted by tech on
October 15, 2009
|
|
Ever had the experience of being frustrated in NetBeans when you resize your window container but instead resizes itself back to a bigger size? When using a Free Layout to place your components in the container, sometimes we resize the container so we can position the components according to where we want to place them.
But what if after positioning all your components, you resize your window form so that it will be the right width and height and it suddenly resizes itself back to a bigger width and height. This was an annoying experience for me. The solution to fix this is to place all your components in a JPanel. Chances are, you added components directly to your window form, adding it to the ContentPane. Just use a JPanel or any other container and you will be fine.
Found this post useful? Buy me a cup of coffee or help support the sponsors on the right.tags: form, netbeans, resize, window
No Comments
Javascript: Check If Popup Window Exists Using Its Window Name
Posted by tech on
September 11, 2009
|
|
When you create a popup window in Javascript, you use the function window.open(). The second parameter, refers to the window name which, usually is useful to avoid duplicates if you have a purpose of not having duplicates. Because of this property, the window name can be used to check if a popup window of that name exists or not.
Although there is no direct way to detect if a popup window with that name exists or not, what you can do is place the window name in an array object then browse the array’s contents to see if the window name exists or not.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | var winnames = new Array(); var ctr = 0; function doesPopupExist(window_name) { var exist = false; for (i=0; i<winnames.length; i++) { if (winnames[i] == window_name) { exist = true; break; } } return exist; } |
Adding the window name to the array object, you can do this.
1 | winnamess[ctr] = window_name; |
Then you can use the doesPopupExist() function to see whether the popup window with that name exists or not.
Found this post useful? Buy me a cup of coffee or help support the sponsors on the right.tags: popup, window
2 Comments
Change Setting To Open New Tab Instead Of New Window In Safari In Mac OS
Posted by tech on
July 3, 2009
|
|
I have never been an avid fan of Safari because the browser stinks. But after I checked out Safari 4, I noticed its speed and how it handles its resources basing on the performance when I use the browser to surf sites. Even until now though, they still do not provide the option to set Safari to open sites in a new tab instead of a new window.
I know, pretty annoying right? You are doing something, then once you click on a link, all of a sudden a new window pops up instead of a new tab. What is the point in producing a tabbed browser if this option is not provided. For Mac OS users, there is a way to do this but it is not within the browser.
You would have to open the Terminal program located in Applications > Utilities and type the following and press enter.
1 | defaults write com.apple.Safari TargetedClicksCreateTabs -bool true |
That is all. Restart your Safari and you should be getting those new tabs that you so desire.
Found this post useful? Buy me a cup of coffee or help support the sponsors on the right.
/rating_on.png)






