Custom Components in WindowBuilder - java

I am trying to make my own Java component for use with windowBuilder in eclipse. Creating the component is the easy part. The problem is getting eclipse to draw the component when one is created.
I have tried using SWT designer but that doesn't exactly work (can't make completely custom components).
Example:
If I want to create a Line component, which has 2 point members, I can't set the points from the design view of eclipse.
I was wondering whether this can be done.
I realize this might sound vague, and I will make any clarifications needed.

To preview use:
It should also be possible to add custom component to WindowBuilder:
right-click on the swing palette, then choose Palette manager .
You'll have the option to import a jar file to be added to the palette.
I am not familiar with an option to make a custom component visible in the static WindowBuilder view.

Related

How to get Matisse GUI to show up my custom added components? [duplicate]

I have been trying for the past few hours to figure out how to add a label component to a window however with no prevail. I have created a new desktop application project in Netbeans and it comes with pre-generated code. I want to add a label to it but it just does not show?. I am unsure as to why because i am following the normal panel.add(component) convention.
Would really appreciate some help!. I pasted the full file sourecode here http://pastebin.com/qJk6bSWn .
Any ideas?
What layout is your JPanel using? If it's using the Netbeans GUI builder default of free design you won't be able to manually add components. You'll need to set it to some layout manager.
Parts of your gui can have the Free Design layout, but you'll need to change the layout of the components that you want to manually add to.

Using NetBeans UI designer, how can I copy UI components from one project and paste them into another?

I'm using NetBeans 7.4. I've created a new UI using the designer. I would like to use a old UI design from another project in this new project, "cutting and pasting" all the components from the old design's JFrame and inserting them into the new design's JPanel.
Does NetBeans provide any method to do this in the design tool rather than the source? I'm hesitant to edit the generated code, having corrupted designs in the past.
If the form is in a separate class, a possible solution is to import the component from the old project with the Palette Manager.
Menu: Tools => Palette => Swing/AWT Components => Add from Project
The component will be available in the Palette.
Open the design tab of the frame you want to copy, then hold Shift and drag the mouse over all the design elements.
You can then copy them all and paste in another JFrame.

how do i get a collapsable pane like the netbeans palette

i like the style of netbeans palette (Window -> Palette, best seen when creating a gui). i would like to integrate a similar collapsable panel in my application, but i have no idea how to find this component. i guess its not a standard swing component, although it looks kind of similar to a jTree. i poked arround the netbeans framework, but i couldnt find the corresponding class.
I know about swingx's JXTaskPane, but i would really prefer an easy, clean way to hide, show and group ui components, without fancy-animation bloating my app needlessly. The netbeans palette seems just perfect. but how is it called & where can i find it?

Adding a component to jpanel in netbeans

I have been trying for the past few hours to figure out how to add a label component to a window however with no prevail. I have created a new desktop application project in Netbeans and it comes with pre-generated code. I want to add a label to it but it just does not show?. I am unsure as to why because i am following the normal panel.add(component) convention.
Would really appreciate some help!. I pasted the full file sourecode here http://pastebin.com/qJk6bSWn .
Any ideas?
What layout is your JPanel using? If it's using the Netbeans GUI builder default of free design you won't be able to manually add components. You'll need to set it to some layout manager.
Parts of your gui can have the Free Design layout, but you'll need to change the layout of the components that you want to manually add to.

NetBeans JFrame GUI all JLabels are grayed out when running

I'm having a problem with the GUI of a java project. I construct the GUI using the Netbeans GUI-builder. In the construction field, more specifically, Netbeans all the JLabels appear deep black but when I run the file (shift-F6) all the JLabels appear grayed out.
Here are some screens to clarify the problem:
In Netbeans: http://i51.tinypic.com/zl3z1j.jpg
While running: http://i56.tinypic.com/fnfwc0.jpg
What could be the cause of this problem?
This may be a look-and-feel problem. I seem to recall that the Netbeans GUI builder uses your system native look-and-feel. By default, however, your application will probably use the Swing LAF (the name of which I forget just now). This means that when you run the application, you won't see the same LAF as you see in the GUI builder. The colors used by the two LAFs are slightly different.
See this Java help page for some options on setting the look and feel. However, since it looks like you're going for a custom look anyway, you might be better off setting all of your colors explicitly.

Categories