Netbeans JApplet Webstart - icons not appearing on button when run - java

Hey there - just wondering if anyone knows the trick to getting icons to display on button in a JApplet. When I add the icon from a png in my package via the properties panel it turns up in the NetBeans IDE as expected but when I run the launch file it isn't there. I can confirm that the file exists in my Jar and no exceptions seem to be thrown in relation to missing files.
If I create a similar application using a JForm and run it directly from NetBeans the icon appears as expected.
EDIT:
It seems this is confined to Chrome... works correctly in IE9 and FF 3.6
EDIT:
Replicate as follows - no coding required:
Create a NetBeans 6.9.1 Project with the following settings:
Java --> JavaApplication
[Next>]
Name e.g. JavaApplication1
Untick "Create Main Class"
[Finish]
Add a png image "MyIcon" to the src directory.
Right Click "JavaApplication1" Project in Projects panel and select New -> JApplet Form
[Finish]
Drag a button onto the form, right click -> properties -> icon and choose "MyIcon" from the pre-populated dropdown menu. You should see the icon appear on the button in the IDE.
Build the project, then navigate via explorer to the dist/launch.html file and run it in Firefox or IE and the icon will be there, run it an Chrome 10 and it won't.

It seems this problem magically went away and now I wish I had noted the exact version of Chrome that I had so that I could tell whether it updated or not. I worked around the problem but inadvertently left an icon on a button - I started work again today on my project and how-you-doing there was a lonely icon on a button - there are three possible reasons why this happened:
1 - I shut down my machine overnight; aka restart (93% Sure this was it)
2 - I moved the entire Netbeans project to another directory (5% Sure this was it)
3 - maybe but unlikely Chrome updated itself with a fix (2% Sure this was it)

Related

Eclipse isn't showing anything

The screenshot of my starting eclipse page.
So I'm very new to eclipse. I'm 16 and need it for school, I've been using it for 2 months now.
One of my assignments was to use JFrame and create a GUI which I had to import into eclipse.
However, when I created the java project and then tried to use JFrame it would show me the source(I think that's what its called) but wouldn't let me open the design part.
So then I tried to create a class in a new java project and it wouldn't show me any code so I deleted eclipse and tried to install it again.
Which I did twice and now I just get this screen whenever I open it. I can't find the project explorer and I cant use it.
Please help me to fix and get the screen back to normal with the console and terminal and package explorer visible as well as how to use JFrame properly.
Click Window > Show View > Project Explorer as shown below:
Similarly, open other views like Console, Problems, Outline etc. (whatever you need).

Running Projects in IntelliJ

I've got a project from my teacher, in which i should add my implementation for a certain aspect.
The Project already got a main method but still the "Run" and "Debug" buttons in the top right corner are greyed out.
I've also tried right clicking the main method and java file, but it doesnt show me run or debug.
Also tried using the "Make Project" Button (top right corner), but it doesnt let me run it either.
How can i run the project?
Help would be much appreciated cause I cant seem to find a solution...
the "run" and "debug"-button in the top run the currently selected main-method. As long as you haven't selected one, you can't run it. In the current version on the left side of the editor-pane, there should be a green arrow right next to the main-button. Run it once via clicking that arrow and from that point on you can run/debug the program using the buttons on the top-window.
In this image you can see the green arrows (version 2016.2.4).
Alternatively, you can use the following more complicated, but also more versatile option:
Directly from the run- and debug-buttons is a button that toggles a list. In the initial configuration of the project, this list contains exactly one Item: "Edit Configurations...". Use it to create a custom-target - go for Application, if your using a java-class as entry-point - and set up the configuration as you wish. Clicking the arrow mentioned earlier does basically the same with a bit of automatic configuration.
Third alternative:
Open the context-menu on the main-method. It as well contains options to run and debug the program with the marked method as entry-point. Works for the context-menu of the respective class as well.
You have to add a run configuration. Do this with clicking the grey button and then clicking at sth with configurations (i am not in front of my PC), then add there the config
Does your main method have the proper syntax for arguments? I found that in Eclipse, the program will not let you run the main method if it is not in the format of public static void main(String[] args). Also, does your code compile properly and your IDE just doesn't let you run it?

Right Click Not Working in NetBeans 8.0.2

I installed NetBeans 8.0.2 recently, and tried to set null layout for a JFrame.
Tried to proceed but RIGHT CLICK on the frame didn't work. I am actually trying to set a background image for a frame.
Someone has already posted cannot right click on Jframe or Jpanel in netbeans 8.0 but it has no answers.
How to fix this problem? Hope that someone has found a solution.
It works for me to right-click on a JFrame and use Set Layout -> Null Layout with Netbeans 8.02. They did not remove it as an option. My guess would be that it is a problem specific to your configuration and/or installation.
Close Netbeans, delete your user configuration directory and cache directory ( see http://wiki.netbeans.org/FaqWhatIsUserdir ) and reopen Netbeans. If the problem persists use View -> IDE Log and add the Error messages from the log to your question. After opening Netbeans, only try one thing and then copy the log so you don't have a bunch of irrelevant error messages in the log.

Eclipse Not Showing Errors on Lefthand Side

So I've been using Eclipse on my mac for the past 4 months with no problems but suddenly things are acting up. Before, Eclipse would show me a red dot on the lefthand scroll bar when I was working on a class in a project. Now, for some reason, all it does is grey-out that line number but it does not show me that dot like it used to. I've tried restarting both Eclipse and my computer, I've tried working on different projects and classes, I've made sure a project builder is selected, and I've checked that the "show errors" options are all checked. I do not like having to have another window open to see exactly where all my errors are; I preferred just having the red section on my class screen. Any other suggestions?
Thanks everyone!
You could try looking here: Error indicators in file margin in eclipse indigo
Open Preferences, select General/Editors/Text editors/Annotations, and make sure that the errors/warnings are selected to be displayed in the Vertical and Overview rulers.
or
Figured it out, if you go to system preferences > general > click the "when scrolling" button, to only show the scroll bar when scrolling it fixes it. Mine was previously on "always". I restarted eclipse and it shows the errors/warning message etc now.'

Eclipse Sample action set button missing while developing plugin

OS: Windows 7 x64; Eclipse IDE for Java Developers (Juno SR2)
I am following tutorial from a book for devlelopment of Eclispe plugins. At one point I made a mistake so I decided to delete whole project (I selected "Delete project content on disk (cannot be undone)"). So I started fresh. But then, after just few initail steps: File -> New -> Other -> (Wizard) Plug-in Project, Next, Next, selection of Hello, World template, -> Finish when I run project it was supposed to get button on the toolbar when Testing -> Launch an Eclipse application is executed.
But this time there was no buton at all (Eclipse launches new instance of Eclispe). Also, I couldn't find it in Customize Perspective -> Choose which tool bar item to display (it should be under Sample Action Set).
After few failures, including erasing "runtime-EclipseApplication" folder on disk, I created new project, named just "Hello World", and this time it works OK, the is buton on toolbar, and there is item "Sample Action Set" in Customize perspective, and there is even "Sample Manu" on Menu Bar. Now, even if I start HelloWorldProject it also has a button and menu item etc., i.e. it works as it should.
But, if I now delete HelloWorld, then even HelloWorldPlugin reverts back (!) and now (when test instance Runtime WorkBench is started) it again don't have button and menu bar?
What gone wrong and how should I fix it? I mean this is just an example, I can just go on with another project name, but in real production environmet if I have strict specification I can't get out so easily, and that is why I would like to know what happend and how to fix it?
I found how to fix it, but I still don't know why it happened on the first place and especially why it persisted, even after several complete deletes of project?
The fix is: Run -> Run Configuartions ->Plug-ins tab -> Workspace -> (select) HelloWorldPlugin.

Categories