ComboBox items are overlapped - java

Please have a view of the attached image.
I use VLCJ to build this application. However, it is unexpected that the item in combobox is hidden by the Canvas (which is used in VLCJ player). How to solve it?

Depending on the jre version the following line may help:
comboBox.setLightWeightPopupEnabled(false);
which tells swing to use a heavyweight dropdown instead of a lightweight one.

Similar issue has been answered here, Swing: Canvas overlaps menu.
NB:
A comment on the answer there is suggesting the use of JComponent instead of a Canvas. Consider that.

Related

A hybrid version of TableViewer and TreeViewer

I need a Java SWT widget that can help me achieve what is shown in box 3. It should have the indentation of a tree but not display the twistie. Have tried NatTable too.. but it doesn't help.
Else, are there any hacks to achieve this?
As you are not allowed to use Nebula widgets and the customization of the native widgets below on OS layer is not recommended (it might break with each OS update) the only solution I would see is to use custom drawing. Maybe by painting over the icons.
How to do custom drawing in a table or tree is explained here: https://www.eclipse.org/articles/article.php?file=Article-CustomDrawingTableAndTreeItems/index.html

Is it possible to make slide Menus in Java Swing

I am stuck trying to make the following kind of slide menu in Swing.
I have searched entire web but I didn't find any tutorial or maybe I missed that. Can you please suggest a solution or a tutorial? I don't need code but just the components to use.
This is very simple in Swing.
What you are looking for is a JSplitPane. You can start with it closed and it has arrows (or other symbols depending on your look and feel) that can be clicked on.
http://docs.oracle.com/javase/tutorial/uiswing/components/splitpane.html
Note: A slider is a very different component. (http://docs.oracle.com/javase/tutorial/uiswing/components/slider.html)
Edit: Based on your comment it sounds like actually are looking for an animated opening of the slider (which is hard to tell from a static image).
In that case this question is a duplicate, look here: Animation for divider movement in JSplitPane

How to resize controls at runtime in java

Is there a way to resize a control, a JTextfield for example, at runtime in java? I want my textfield to have the resize cursors (just like when you point your cursor on the corner of a window) and will be able to resize on runtime. Ive read on the internet that vb6 and C# have those capabilities, is there anything for java? A sample code or a link to a good tutorial will be very much appreciated. Thank you.
It sounds like you are trying to implement a component editor, such as the GUI editors available in popular programing IDEs. The essential feature is a handle, a graphical object that can be selected and dragged to change the geometry. GraphPanel is a simple example of an object drawing program that illustrates many of the required techniques.
That depends on the Layout of the JTextField's container. A good tutorial is available at http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html
For a quick and cheap solution you could use a JSplitPane component, with the JTextField to be resized in the left side, and an empty JPanel in the right side. By default a JSplitPane is decorated with a border and a divider, but you can remove these by setting an empty border.

Can the dimensions of header area of JXTaskPane be changed?

I am using JXTaskPane component. I want to know whether one can change the dimensions of the top part of the task pane i.e. the area where title of the task pane is displayed. If yes, please let me know how?
no, that's not supported: the "top area" is part of the Border which is installed deeply inside the ui delegate. You might consider to file an enhancement issue in SwingX' issue tracker.

Add transparent JPanel upon AWT Component to paint on

I've got a Problem: In my Java application I've got an AWT Component (cannot change that one) that streams and shows an avi-file. Now I want to draw upon this movie and thought about putting a transparent JPanel above it and draw on that one.
This does not work since I either see the avi-stream or the drawn lines but not both.
I read somewhere that AWT does not support transparency of components - but the panel is a JPanel which is able to do so.
Can someone please help me with this one - thanks in advance.
The Mixing Light and Heavyweight Components article explains how this is handled only in the most recent version of the JDK.
did you try a GlassPane since i think thats exactly it's use case. soemthing like JFrame.setGlassPane() if i remember correctly. check here:
Java API JFrame
GlassPane examples
I've searched for a heavyweightcomponent that could help me but I didn't found one, and regarding the internalframes I don't know how you managed to set the opacity to 50. All what I found about seetting the opacity wast the method setOpaque(boolean value) and this doesn't help me at all. Would you please explaine me how did you set that opacity. It's my final alternative either that or I'll have to change my entire project design.
Try running Stream and Drawing on separate thread. I think this can help

Categories