Lately, I've been working on a project in NetBeans using the GUI editor that's built in. Before I noticed that it generated an XML ".form" file that didn't appear in the Project Explorer Pane which makes sense. Earlier I was working on the form in the "Design" tab when it notified me about 15 updates. I just updated without reading anything which was probably a bad idea but when I restarted the IDE, it showed my GUI ".class" file and ".form" file separately in the Project Explorer and I couldn't switch between "Source" and "Design". I also noticed that the generated code that was usually not editable was now editable.
P.S. I'm able to create a new frame just fine and the design editor still works with new frame
I have encounter the same problem and I have solved it.
The key in this problem, I think, is particular plugins for JFrame in Netbeans are not active after updating, so we only need to activate them. The easiest way to achieve this is create a new JFrame class, so in this progress, NetBeans can activate all relevant plugins for us. Finally, restart NetBeans, then everything would be fine.
Thank you very much for all of you that you give me some idea and clues in this situation:)
Work on a similar problem led me to this discussion concerning Guarded blocks inside form Java source file. I'm not sure it's related to your situation, but it may help you recover.
If you are trying to recover the lost state of the backing xml for the form I don't know what to tell you.
This has happened to me, but I tend to highly componentize the forms (break up the forms into little pieces), which makes this not such a big deal. Have you tried the NetBeans forums? You might get better luck there:
http://forums.netbeans.org/
Nevermind, simple solution.
I finally decided that, after plenty of tinkering, to restart the IDE which I should have though of first. The Java SE Plugin must have crashed or something, anyway it's fixed.
Thanks for the help!
Or just right click on the corresponding .form file and select open. The Design tab/editor reestablishes.
Related
I am trying to write a plugin for the Universal Gcode Sender (https://winder.github.io/ugs_website/), but when I try to create a JPanel in any directory except my module's main project directory and try to use the Design tab, it just shows the text "Loading..." and I can't do anything in the Design tab. This also happens when I create a new Netbeans Project and try to make a JPanel there.
I don't think this is because of an issue with UGS, rather a Netbeans issue or something.
I literally haven't been able to write any code because the first thing I need to do is make sure I can use the Design tab. Netbeans is entirely stock, I haven't changed anything to cause this.
I have tried multiple re installations of Netbeans and various other solutions. Nothing has worked.
I appreciate any help you can give. If I am missing any important info please tell me and I will supply it.
I made a JTabbedPane using Netbeans 7.4. After adding a few things, I decided I didn't want all of the tabs I have created anymore. I then simply compied the JPanel inside of the JTabbedPane onto the same JFrame, and deleted the now unused JTabbedPane. Thing is, all the variables used are still being initialised in source code, even though they do not show up in the Design Navigator or on the JFrame in design mode.
I know I can simply edit this out with a external editor, but I am afraid that the Form data will be corrupted. (This has happened to me before and I lost the ability to edit using Design Mode.)
I used the inspector and FindBugs, but I failed to remove it from there.
"Why am I using Netbeans!?" - A question I won't be asking myself again after I sort this out.
Your first real problem is you are using the Design Mode. Netbeans isn't the problem as is is more than capable of working by itself with code only (I will always only use code).
It is really easy to break a program with a incorrect move within design view.
There isn't really an easy way to go about fixing it, although IMHO sift through the code and find what you need to remove. Make a copy of the .java file first so you have a backup if it breaks!
So for example with my current object tabPanelMain, I'll type a dot after it and expect to see a drop down menu of all the object's available methods. Instead, the marker which shows my currently selected character on the editor disappears meaning I don't know where I'm typing. Worse than that is that the save and save all buttons stop working. And ctrl-s and the menu saves don't work either. I can't save my eclipse projects and have to restart, thus losing my work.
What could be wrong? This problem never used to exist but now I just can't get the methods of an object like I used to.
I hope that was clear enough, please ask me questions if not.
The save problem with not being able to save is one I've encountered before.
I don't know why it happens but for me it helps to minimize and then maximize eclipse again.
Not a fix but at least a workaround that lets you save.
Never heard of the other problem though.
I couldn't figure out what it was that was causing the problem, and while Martin Larsson provided an effective short term solution, I found it best to fresh install Eclipse.
The most annoying part about this was transferring my previous plug ins (like GWT, Subversion, etc) over to the new install. In the end I ended up re-installing them manually. If anyone could shed some light on how to keep previous plug ins, I'd like to hear how. Though I've heard this can be problematic with path urls in the files or something.
I am looking into the NetBeans platform for developing desktop applications. I am a complete newbie in it. I understood till now the module architecture. Now I want to do some GUI work. My question is very simple and feel embarrassed to ask it, but how can I edit the main frame of the application? I mean the one generated automatically by NetBeans. I looked around but for god's sake, I can't see it in the IDE:(
Edit: It seems there is a misunderstanding. I know how to create a JFrame:) I am talking about the NetBeans platform, when your application is built on top of the NetBeans core. Here is a short article. At the bottom there are two screenshots. The IDE generates a Main frame looking like the real NetBeans IDE. I can create new modules and so on. But I want to edit this Main frame, but I don't see it in the IDE. Hope my question is clear now.
Thanks in advance:)
Regards,
Petar
As I learned more things of the NetBeans platform, I understood that there is a virtual FileSystem which is build from combining layer.xml files from all modules. This FileSystem is the configuration of the application. It includes things as which menu items to be shown on the main frame, etc. So I guess the main frame is edited this way:)
Yes, is like Petar says, but to be more specific, one way to do this is from the Netbeans GUI is described here. http://platform.netbeans.org/tutorials/70/nbm-htmleditor.html#tweakingthemenuitems. This is for 7.0 version of netbeans.
I found useful this question also How to remove items from menu in netBeans platform?.
I can split editor panes horizontally or vertically, but it does not seem possible to view code in two separate physical windows. I am aware that Idea can open multiple projects in separate windows, but I'd like to be able to do this for two files in a single project.
One answer suggested unpinning the tab, but I haven't been able to make that work (I'm on Mac OSX if that matters.)
This seems like a basic feature in today's world of multi-headed workstations. Before moving to an IDE I used to do this regularly with good old Emacs. Is there some trick I am not aware of to make this happen?
This is now possible in IDEA X. Hopefully you're still an IDEA user and can take advantage of this :)
Unfortunately there is no way (as of IDEA 8.0.1) to do what you're asking for. As you pointed out, you can split the editor pane but there is always exactly one editor per IDEA project.
UPDATE: As of IDEA 10 (currently the latest is 10.5), the answer is yes, you can :-)
I work around the limitation by opening one source file in vi, on a second head monitor.
Then work main file within Idea (actually Pycharm).
Update: even with the feature built into pycharm, I still use vi. Works better.
As per #9000's comment, an editor tab can be turned into a new window by dragging the tab outside of IDEA.
Yes- with IDEA X, it is finally possible to open multiple editor windows.