Loading panels from different files - netbeans-8

I am using netbeans to design my Gui app
I added a jframe with tabbed pane. For each tab, I created a Jpanel in its own Java file as I don't want everything in one file
So in the first jframe file, I modified the "custom code" so it uses the Jpanel I created.
The problem is that the Jpanel is not shown when I run the program. I believe because the first file is sitting it's own layout and overwriting the layout of the Jpanel on the other file. I tried to remove the layout setting but it is generated code and not letting me do so. what do you say I should do to fix that?
Is there a way netbeans to tell it to load panel from another file? Or is There a way I can remove the layout setting from code generation?

I Can see both panels in the frame and didn't had to create any custom code.
I Create a JFrame and both JPanels.
In the JFrame inserted a Tabbed Pane.
From the "Projects" window (usually in the top left side of the editor) dragged both JPanel to the JFrame (one at the time)
And when I run i can see both panels and all of its components.

Related

IntelliJ - Is there a way to move the SceneBuilder to the right side of the IDE?

When I'm building the layout with IntelliJ using FXML, the layout can be viewed by using the SceneBuilder in another tab.
Is there a way to make it so the FXML code and scenebuilder can both be viewed at the sametime so I don't have to keep alternating back and forth between the two panels Text and SceneBuilder?
In Android studio the equivalent of the SceneBuilder would be the Preview which is located all the way on the right side of the IDE.
How can I move the SceneBuilder all the way to the right like so? Or is there something else that is used to preview the layout that I'm unaware of?
To display, within Intellij Idea, both the fxml source view and the SceneBuilder view at the same time, for the same FXML file:
Double click the FXML file in the Project Pane to open it.
Right-click on the tab header of the FXML file.
Choose "Split Right" or "Split Down" depending on your preference.
You will now have two tabs for the same FXML file, both showing the FXML source.
In your second tab for the FXML file, click on "Scene Builder" in the bottom tab.
You will now have your source FXML and the Scene Builder FXML for the same file side by side.
(optional extra) If you want a source view or Scene Builder view in a new window rather than a new tab, right-click the related tab header and choose "Move to tab to New Window".
Unrelated aside
For me, on a Mac OS (10.15), Scene Builder inside IntelliJ (2021.2 UE) shows garbled fonts throughout the application making it unusable (the stand-alone SceneBuilder app from Gluon does not have this issue). Hopefully, it works better for you.
Intellij bug tracker link for the unusable fonts in SceneBuilder on Mac when embedded in Idea IDEA-266524.
So, this is a known issue which Intellij will hopefully address in a future release.

How to use the GtkHeaderBar in glade 3.20?

I tried to do a GtkHeaderBar application with glade 3.20, but I have the oldschool bar on top every time, when creating my python app.
In glade 3.19, checking the client-side decoration property created a line on top, in which I could put the GtkHeaderBar. This is not the case in the latest version.
I tried to check/uncheck every property, I could not find the way to do this. That is very surprising, since this should be the default way to do a Gnome application.
I looked on the internet, but there is dramatically no documentation on gladeā€¦
After searching, it seems that I must add a GtkHeaderBar as child in the main window. But how, that is the mystery.
Create the window, set the "Client side window decorations" property to True. Next, get the HeaderBar widget from the toolbox and drop it on the top part of the window that just appeared:
And here you are, the header bar:
Ok, I found by myself a workaround:
We need to create the GtkHeaderBar apart, and after activating the client side decoration property, we close the project. Then, by editing the XML file, we put the header bar section into the titlebar section, instead of the placeholder xml tag. When we reopen the glade project, that's ok, the header bar is in the window.

Load dynamic splitpane in javafx using fxml files

I have a main jfx class having splitpane.
On the lefthand side, I have a treeview and right side is blank. This is created using main fxml file. Now the requirement is the right hand side of splitpane should be loaded based on event of the treeitem on the lefthandside of the pane. Of course the righthandside should display contents of the new fxml file.
Can anybody provide a small example in order to achieve this?

How to reopen ViewPart?

I am working to make an Eclipse Plugin. I used a plugin project template that generated a View class which extends ViewPart. I think that it is part of SWT.
My problem is that the View is like a window inside of the main Frame which has buttons for close, minimize. I clicked on the X button of the View by mistake. Now I cannot make it visible again even if I relaunch the Eclipse Application.
Now, my Eclipse application looks like this:
It had some panels and buttons before. But I cannot make the View visible again. How should I make to bring it back? I have tried to delete the plugin project from Eclipse and import it again. But it did not work.
I bet that there it is an easy way to make the View visible again but I do not know how. Is there any setting through MANIFEST file? Or other file?
Specify the -clearPersistedState argument when you run the RCP (this assumes you are using Eclipse 4.x).
1) quick solution
restart workbench with clear workspace option checked under run configuration ..
2) Full Solution
you should add a menu in menu bar to open your view so that you can open your view when ever you want
create a command say openMyMenu
create a handler for it and call below code from handler execute method.
add that command to main menu bar..
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(<view ID>);

VB.NET Adding an image so that it shows up under My.Resources.TheImageName

Using VS2012, I would like to add an image to the My.Resources. namespace.
I would like to draw this image to a PictureBox on the Paint event.
I did the following:
I clicked "Add existing item", then I opened up the image.
I clicked the image from the Solution Explorer and set the Build Task to "Embedded Resource".
I saved the project and re-built it.
But it still does not show up under My.Resources.
What did I do wrong, please?
Thank you for the help!
ps:
I do not want to add it directly to "Resources.resx" (for example by clicking the "BackGroundImage" property of a form).
I would prefer having the image in the solution explorer instead. I once experienced that VS2012 once damaged a file, and I had to rebuild the resource file. I would like to avoid it.
You need to add the image to the Resources tab in Project Properties, not to the project directly.