Running a Simple Program in J#
I put System.out.println("Hello World"); I build the application.
It compiles clean. How do I run it? It's not too obvious. I did
install the J# Redistribution Package. HELP! This is so simple..
but I'm stumped!!!
I guess your expecting "Hello world" should appear in the Win Form right? But nothing will appear in Form because you are writing to Standard output which is not WinForm in case of Windows Applications.
If we want to print something in WinForm, you should add few WinForm controls like textbox and text field.
Steps to add WinForm controls to WinForm
- Open Form1.jsl[Design],
- Click View--> toolbax to get view all Win Controls
- Expand AllWindows Forms and drag and drop either TextBox
- In Form1_Load(Object sender, System.EventArgs e), add textBox1.set_Text("Hello World"); this line and execute it.
If you are new to WinForm then try playing with Calculator startup kit which you can find under "File --> New project" Project Types: Visual J# --> Starter Kit in Visual Studio 8 , 2005.
That's the problem ..there is no Play button.
So I did select Start(without debugging) from the debug menu and
another window pops up "Just in Time Debugging" and it wants me to select
a debugger and it asks whether I want to debug with the selected debugger?
I do not know which debugger to select so I answer the question with a NO!
Nothing happens. BTW, where does the output for System.out. println go?
Which window displays it? Thanks so much!!!
Anyways, that's the ideal way. If you really want to see the output of Windows application in console window then change the output type of the project to Console application. Please follow steps below to do so...
1. Right click on the project node in solution explorer.
2. Select Properties... from context menue.
3. A Designer is opened in the editor. Select Application Tab.
4. From the "Output Type" drop down, select "Console Aplication".
5. Save the project.
Now if you run your project from Visaul Studio, both console window and a form window will appear. You can see the output in the console window.
Regarding your second problem that a JIT debugging window pops up when you press F5, i think there is some exception being thrown in your code which is not handled. Please review your code and let us know if it still comes.
Please post back if you still face any issue.
Thanks.
Thanks so much...I made it a console application and output is written to it but
the output is some kind of error "unhandled exception System.Security.Security Exception: Security Error". Do I need to change something? I have administrator privilege on the machine. Thanks so much for your help....I'm thinking about not using Visual NET and going to JCreator or JBuilder or NetBeans!!!!
Hi,
Can you please post your code here? Just running a helloworld program should not throw any exception.
Also can you please tell us that which version of Visual Studio are you working on?
And please don't give up Visual Studio just because of one odd issue. We are really sorry for the inconvenience but we have never faced any such issue for a simple print statement. We will surely find out the root cause and I am sure once you start using Visual Studio, you will just love it.
Thanks.
Something like this
public } Visual Studio with .NET offers you many features which will help you to develop any application in effective and efficient manner. Iām sure you will appreciate once you get hands on experience with the language. Please feel free to get back to us if you need any kind of help.
{
try
{
// your code
}
catch (System.Exception ex)
{
Now ....I'm trying to create a Dialog box using JOptionPane. Does J#
support the Swing Class?
To add a reference to vjssupuilib.dll...
1. Right click on project node in soln explorer.
2. Select Add References... from context menu.
3. In Add Reference Dialog box, select .Net pane.
4. Select vjssupuilib.dll.
5. Click ok.
Thanks.
To see Object Browser, Click on View --> Object Browser or View --> Other Windows --> Object Browser.
ClassView (Invoke View --> ClassView) is another handy tool to explore your code projects and solution.
Hope this meets your requirement.
Thanks.
I have another problem. My VB kids cannot run their applications!!! They
do Start without debugging and an error comes up "Error while trying to run project: Unable to start debugging. Access denied. Verify that you are an administrator or a member of the 'Debug Users' group..."
I cannot add each user to the debug users group of each machine...sometimes kids switch machines . How to I get around this? What can I change in .NET's security ...HELP