I use Netbeans 7 on Kubuntu 12.04. I start Netbeans like this:
netbeans --cp:a /usr/share/java/xercesImpl.jar &
cause of known issue with Netbeans and Kubuntu 12.04. In the middle of my project my palette with Swing components just .. disappeared!
I see only sth like this:
How to restore default Netbeans palette?
I checked Ctrl+Shift+8 shortcut but with no results - the problem is still the same.
**EDIT:
I dont know what I did but now I see ONLY EMPTY palette :( : **
I also tried this:
1) I cd'ed to /home/mazix/.netbeans/7.0/config/Windows2Local/Groups/commonpalette
, ls'ed and saw only this: CommonPalette.wstcgrp
2) cd'ed to /home/mazix/.netbeans/7.0/config/Windows2Local/Components and saw this:
AnalyzerTopComponent.settings output.settings
AnalyzeStackTopComponent.settings projectTabLogical_tc.settings
breakpointsView.settings projectTab_tc.settings
CallHierarchyTopComponent.settings properties_1.settings
callstackView.settings properties.settings
CommonPalette.settings refactoring-preview.settings
ComponentInspector.settings
ReporterResultTopComponent.settings CssPreviewTC.settings
resultsView.settings debugging.settings
search-results.settings DeclarationTopComponent.settings
services.settings evaluator.settings
sessionsView.settings favorites.settings
sources.settings find-usages.settings
StyleBuilderTC.settings gsf-testrunner-results.settings
svnversioning.settings hgversioning.settings
synchronize.settings JavadocTopComponent.settings
TaskListTopComponent.settings localsView.settings
TerminalContainerTopComponent.settings
MultiView-java#007Cform#007C_1.settings threadsView.settings
MultiView-java#007Cform#007C_2.settings versioning_output.settings
MultiView-java#007Cform#007C_4.settings watchesView.settings
MultiView-java#007Cform#007C.settings Welcome.settings
navigatorTC.settings
and didnt see any _hidden files :(
Open NetBeans and choose Window -> Palette
It will appear but it will be empty because you didn't choose a GUI class yet.
To fill the palette with the GUI components like labels, follow these steps:
Create a new project .
Right click in the package name or project name, and choose New -> Other...
In the New File dialog box, choose the "Swing GUI Forms" from category and the "JFrame"
Form file type sub window. Click Next.
Enter name lets say "MyGUI" for the new the class which you created now.
The palette window is now full with components like labels, text,checkboxes, ...
if not appear yet make sure to press "Design" button in the upper of the GUI class bar "MyGUI"class
I got the same issue and this work for me window -> reset window. hope it work for you :)
I think the same problem occur here.Check this solution.it may helpful to you.
This steps for restore the default palette?
Exit the IDE.
Go to your user directory and go down to config/Palette subdir. In this directory, the files or directories deleted from the default palette content are presented as empty files with _hidden suffix in their names.
Delete these _hidden files to let the palette categories and items appear again in the IDE.
I think this will help you
Do one thing, simply right click on your netbeans project and then open it. It resolves the problem. You will observe if u open a new project the palette is there, so just copy the project with a different name, its will solve your problem.
In my case after creating a new project without a default constructor, the search box at the palette holds a single character i.e. '='. this results in an empty palette too.
In that case the solution is obvious: just delete the content of the search input.
It puzzled me for a moment, though, not noticing the search input field content.
I had the same situation with my netbeans. The only solution I did was to backup my project folder (saving it to other drive). Then re-install the netbeans. Afterwards I re-paste the project folder at the directory and re-open it.
Right-click mouse button at palette box. Choose command "reset palette".
I encountered the same problem. Just check the bottom of the palette to see if there is a search box open. If there is, close it. Then the palette will be available once again.
So, nothing suggested here worked for me, I am leaving my solution.
You create the project, name it.
Create a package.
Click on the package with the right mouse button
select New filme
select Other
select AWT GUI Forms
select Frame form
Now you should see the menu at the right part of your screen with the option to create buttons, labels, etc.
As of 2021 for mac users;
Open your NetBeans app and click on "windows" located at the top menu of the application. A drop down will appear.
Scroll down and click "IDE Tools". You'll see another dropdown containing list of items including palette.
Click on the "palette". This will make the palette visible.
That's all!
Related
I've been trying to run gui in netbeans using java swing but it won't run at all. All the projects that I execcute that uses jframe does not run. Any tips on how to fix this thing? This is how it looks like:
I got this to run with no problems using NetBeans IDE 8.2. Let's start from the beginning.
Delete your current OfficeManagementSystem project from your IDE and local drive system. Select the OfficeManagementSystem project located within your IDE Project pane located on the left side of the IDE. Right-click on it and select the Delete popup menu item. A Delete Project dialog is displayed. Check-mark the Also delete sources under ..... checkbox then select the Yes button.
Close NetBeans!
To make sure all is gone, open your file browser (in Windows10 this is named File Explorer [win key + E]) and navigate to your NetBeans Projects folder. Default location in Windows is C:\Users\{yourAccountName}\Documents\NetBeansProjects\. Make sure that OfficeManagementSystem project folder is deleted.
With your web browser, go to the Source Code Web Page and select the Code button:
Then from the dropdown menu select Download ZIP:
A Save File dialog will appear possibly similar to this:
Select the Save File option then select the OK button. Choose a location to save the ZIP file and remember it.
Navigate to you downloaded file named HospitalManagementSystemusingJAVASwing-master.zip and Un-Zip it with your favorite decompression software like WinRar or 7Zip. Have it unzip into its own folder.
Navigate to and open the the folder created by your decompression software, it should have been named HospitalManagementSystemusingJAVASwing-master. If done properly you should have yet another folder (a sub-folder) also named HospitalManagementSystemusingJAVASwing-master. Rename this folder to HospitalManagementSystem by right-clicking on the folder and selecting Rename from the popup menu. Delete the unnecessary text within the name then hit your ENTER key.
After Renaming the folder, once again right-click on it and select Copy from the popup menu.
As described earlier, navigate to you NetBeansProjects directory (folder) and double-click on it. Paste the new HospitalManagementSystem folder into the NetBeansProjects folder. This project will now be added to the NetBeans Projects List.
Start NetBeans!
Once NetBeans has completely started, from the menu bar select the File ➞ Open Project... menu item. The Open Project dialog will be displayed. Scroll down the left pane of this dialog until you see HospitalManagementSystem and select it. Now hit the Open Project button. This project will load into the NetBeans IDE Projects pane located on the left side of your IDE under the name of: OfficeManagementSystem. Why this person changed the project name at this point is beyond me but to each their own.
Expand the project and its active package (officemanagementsystem) so as to expose all the classes involved. You should see the following listed:
LoginPage.java // The first Form we want displayed.
MenuPage.java // The Menu page (once login is achieved).
Module1.java // Should really be named PatientPage
Module2.java // Should really be named DoctorAvailabilityPage.
OfficeManagementSystem.java // The application start-up class.
This application still will not run since it contains nothing within the main() method of the start-up class (OfficeManagementSystem). Open this class into the IDE Editor by double-clicking on it.
Expand the main() method code block and add this code line into it:
new LoginPage().setVisible(true);
Run the application! The first Window displayed will be the Login Page. Username is: admin and the password is: admin. (change in code if you like). And away you go. :)
All java applications need a static main method as a bootstrap.
It should look something like the following:
public static void main(String[] args) { YourJFrameClass frame = new YourJFrameClass(); }
That should get you started.
The easiest method is to press Shift+F11 (Clean and Build Project), then hit F6 to run it.
It refreshes Netbeans appropriately and finds your main without all the manual labor; and if you have multiple mains, it will give you the option to select the correct one.
Check if your JFrame Class has this method:
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new YOURFORMNAME().setVisible(true);
}
});
}
The setVisibile(true) allows the form to be visible to the user. The main method is used to define the entry point for the application therefore this method is needed to run the JFrame
I want to create file foder like this:
But in Intelij it always show this:
How can I solve it, pls?
Just unselect option in Project -> (Gear icon ⚙) -> Compact Empty Middle Packages.
Then select a folder and create next package node.
See on image how to turn off flat mode
It flattens empty packages. You could either disable the setting as the other answer, or simply put files into those packages.
I think the real problem, though, it that you are actually making a file structure like this
core
item
lyKhi
nguHanh
You should right click on "core" when you create a new package.
Please the the attached snapshot. In my debugger, I can only see the variable values, but no names. It's very annoying. what might cause this?
I tried everything found in the link that jotadepicas provided. It might be a combination of all those suggestions that lead up to me resolving the variable names not showing.
After trying all of the suggestions, I clicked on the down arrow in debug variables tab --> Layout --> Select Columns. Both the Name and Value boxes were already checked. I simply clicked OK and the Name column displayed. This Select Columns and Show Columns under Layout were not available prior to all the previous steps.
I am running Eclipse Mars 4.5.1 on Linux Mint 17.3.
You could try reseting the Perspective, closing and opening de variables view again, even restarting eclipse. Have a look at this similar question just in case: Eclipse Debug Mode: Variables not showing
It's a rendering problem in eclipse. click on the Variables Tab -> click on the vertically three dots icon appearing in the corner-> Layout - > Select columns -> Deselect all columns -> apply -> go back and select all columns .
This should work.
One frustrating thing I find in Intellij's project view is that it shows all the classes in a file instead of just the class for which the file is named.
The problem with this is that to open a file I have to double click twice: once to expand the file and show the classes in the file, and then a second time to actually open the file.
In most cases I don't want to see the classes inside of a file. I just want to see the file in the project view and when I double click on the file I want to open the file, not drill down into its structure.
Is it possible to configure my UI this way?
UPDATE: further explanation
Apparently people are having problems understanding this question. See the above picture of the Intellij Project navigation pane. Notice that some classes (the blue circles) have a + sign and others do not. The ones with a plus sign are files that have multiple classes inside of them.
The problem is that if you double click on a file with only one class (no plus sign) it opens (GOOD), but if you double click on a file with multiple classes in it (has plus sign) then the file does NOT open, it just expands the plus sign to show you the individual classes in the file as BoxArray.java, for example (BAD).
For example, if I double click on the file Coastline.java in the view above it will NOT open the file, it will expand the plus sign. I want it to open Coastline.java when I double click on Coastline.java, not expand it. I do not care about seeing the classes inside of a class file, I just want to open it in one double click.
I know that I can use the hotkey F4 to do this. I do not want to reach for the F4 key. I want to double click on the file and have it open.
When you enable Autoscroll to Source in the little menu of your Project tool window (View > Tool Windows > Project), single clicking a collection (closed and opened) goes straight to the code as well as folding / unfolding it.
This works in IntelliJ 13.1 and 14 (in OSX and Linux)
You could bind Jump to Source function to double click in Settings -> Keymap -> search for "Jump to Source" -> RMB click and choose "Add Mouse Shortcut".
Now double clicking on file will open it. Drawback could be that from now if you double click on some code to select it you will always go to source..
There is a way to open a file without unfolding/drill down via "jump to source" action. Unfortunately, you need a keyboard to do this. On Mac you use F4/⌘↓/⌘Enter, on linux/windows it is F4/Ctrl+Enter.
go to file -> settings -> Editor -> General -> editor tabs
in tab closeing policy and set tab limit and set it to what number you want.
You can avoid navigating through mouse and even double clicking on the file by making use of the shortcut ctrl + shift + n and just start typing the file name or even just first letters of the words( ex: BA for BoxArray) and select the file. Which will open without asking the class name!!
I'm using Eclipse and I've noticed that I don't get a full list of available methods in my Code Assist whenever I'm using anything under the javax package. For example:
JFrame frame = new JFrame();
frame. // this will open up code assist window, but the window only has methods
// inherited from type Object, not the methods from JFrame
I'm using jdk1.6.0_25 as my JRE, and I ensured my source attachment and javadoc locations are correct for rt.jar, and also tried checking everything in Window → Preferences → Java → Editor → Content Assist → Advanced.
I'm pretty new to Eclipse so I'm not sure what I may be doing incorrectly, if there is any other pertinent information that I have left out, let me know and I'll include it.
I have encountered the same problem, and then I worked it out myself.
In my company classes under these two packages are rarely used (in fact, they are not encouraged). So the pre-installed eclipse just adds them to the filter list.
To fix this, open "Window -> Preferences" and search for "type filters" (in my computer it is in Java-Appearance-Type Filters), and you would see a list of filtered packages, uncheck the "java.awt." and "javax.swing.".
Hope this helps!
I have tried this and works perfectly fine in Eclipse Indigo.
javax.swing.JFrame frame = new javax.swing.JFrame(); frame.//here i get all available methods and everything else i am supposed to...
So, make sure you have the packages imported...
Hope this helps!