Java Swing and Netbeans GUI Designer: How to remove small gaps between components when I set them invisible? - swing

I am a newcomer to Java Swing. I am using the GUI builder of Netbeans.
I have three main panels for three different views in my application. These views can be switched by a menu on the left.
I switch these views by setting one visible and setting the other two invisible. It works but there is a little problem.
In order to achieve this, I had to put three JScrollPanes next to each other horizontally in the GUI builder. Whenever I switch to a view, the small gaps between the visible component and the invisible ones remain when the visible JScrollPane resizes itself to fill the entire window. It makes the application look quite ugly. The same thing happens when I place them vertically.
How can I fix this by using the GUI builder? I can't make changes to the code for the interface design, obviously.
Here is a very crude drawing of the problem, I hope it's clear enough: Link
Using only one JScrollPane is not an option, because they have different layout managers and will have lots and lots of components. It would not be feasible in terms of performance to render everything from the beginning when a user changes the view.
Thanks in advance,
Emre

Fixed the problem myself.
You can prevent this by right clicking to each JPanel component in Netbeans, choosing "Space Around Component..." from the popup menu and set the corresponding spaces to 0 by hand.

Updating the answer to NetBeans 8. You now right-click the component and select "Edit Layout Space" and manually enter the value 0 in the direction with you would like the spacing removed.

Related

tab navigator but spread over two rows in flex

I currently use a Tab Navigator in my flex project and ideally I would like to continue to use it but the problem is there is quite a few tabs and almost all of them end in "..." because their is not enough space to display the entire header. is it possible to display the navigator over two rows?
I'm quite new to flex so if this is an easy thing then apologies.
I think the following link can help you out. Just Check this...
Hope it will help
http://flexponential.com/2011/10/23/enable-scrolling-in-the-tab-bar-of-a-tabbedviewnavigator/
If you are using Spark Tab Bar, the answer from the link above will work. If you are using the old Halo Tab Navigator, there is an excellent component, SuperTabNavigator available as a part of Flex lib.

HTML5 - Drag and Drop canvas (or divs) switching both

I'm new with html5 and I'm trying to go through with drag and drop functionality.
This is the scenario: two different divs (or canvas) side by side.
What I want to do: drag the first div (or canvas) and drop on the second div.
Which result I expect: The first div content is now on the second div position and the second div content is on the first div position. Like a normal switch.
I'm pretty sure that is possible, but the only think I've done until now, was to append the first div into the second div.
Yes, of course it is possible, but the answer depends a bit on what the purpose is... If you want to learn how drag and drop works in HTML5, then write your own implementation based on the tutorial you mentioned. But if you want to build something for production within reasonable time, use a library - there are lots. Which one to use also depends on the platform you're targeting. If you're targeting mobile, you need touch support, and you need to consider multi-touch effects in your implementation - it's not just mouse clicks and drags anymore, but potentially lots of fingers simultaneously!
A nice demo using hammer.js can be found here: http://riagora.com/mobile/hammer/index2.html. Drag and Drop works both with mouse and touch, but you need a touch screen for zooming (by pinching) and rotation of images.
Another demo, a puzzle using scriptaculous, which does almost what you ask for. However, the current version, 1.9.0, is from December 23, 2010, so it doesn't seem to be actively developed anymore.

wxAUI Help - Auto hiding tabs

Can the wxAUI component of the wxWidgets Libary be configured to dock into "auto hiding tabs" like visual studio 2010's own interface does.
This is what I want, panels that can be auto hidden in tabs.
http://imageshack.us/photo/my-images/3/vstabs.png/
This is what I get, panels that take up 1/2 space each and always remain on screen.
http://imageshack.us/photo/my-images/801/wxtabs.png/
Thanks
wxAUI does not currently have any support for this, although it could be added without immense difficulty.

astra as3 panel layout

I'm trying to create a layout not too different from the feed reader sample.
The problem I'm having is that I'm finding the documentation unclear. There are so many different types of layouts that I don't know which one to use when.
In the example, on the right side there are a few horizontal panels:
[feedToolbar(HboxPane)]
[feedItemsGrid(Datagrid)]
[filterToolbar(HBox)]
this does not include the details panel and the resize handle.
I would like to swap the DataGrid with my custom content which is basically a sprite. The problem I have is that I cannot just include a sprite, because it does some funky resizing. I would like the scroll bar to appear when the content is too tall, and have have the same skin for the background as the DataGrid.
shortly after posting...
I've tried BaseScrollPane, a class that DataGrid extends, but I couldn't use addChild.
I came across FlowPane, seems like it did the trick.

Glitchy screen redraws in flex application?

I have a flex/actionscript based project. The project has various view stacks and tab navigators and a few popup windows. The whole thing is managed in pureMVC framework.
When transitioning between various view states, opening a popup, switching a tab, etc, I find the app to exhibit various redraw glitches. Parts of views will be partially drawn or flicker in odd ways. I am fairly confident that the code is working correctly, just seems to be an issue with the overall heaviness of the UI.
Is this a common issue? Are their tried and true techniques to optimize this problem?
In particular what event handlers are available to delay the drawing of view components until the last moment when everything is ready to quickly display to the screen?
Say for example I have a VBox inside a viewstack, and inside this VBox I have a fairly complex datagrid. Can I prepare the datagrid and/or delay the viewstack change until all subview components are in fact ready to be quickly drawn.
What are some possible symptoms to this kind of glitchiness?
just a guess, but this might be related to the flex framework ... i experienced this kind of behaviour too ... i guess it is related to the way flex framework works when carrying out ui tasks ... a lot of deferred instantiations/calls and so on ... when there is a lot going on, the framerate drops and since deferring is framebased, that is probably when the resulting delays become noticable ...
greetz
back2dos
Not sure if this applies to you, but in Firefox/OSX there is a known bug when you make too many javascript calls, and the result is similar as you say... the whole interface shows various glitches and flickers... The solution was to delay the JS calls a bit, so they don't get called too often... this was a serious issue with swfaddress for instance (I think it still is).
http://www.bigspaceship.com/blog/labs/mac-firefox-30-flash-javascript-random-artifacts/
I assume you need the datagrid already attached to its parent container and you are loading data while it's being shown so it constantly updates and renders its content.
Have you simply tried setting its visibility to false until everything is loaded while keeping includeInLayout true and giving it a fixed size?