-
Old to new, basic question.
I haven't used Java in years, now after installing a copy of Microsoft's Visual J# 2005 and importing some old code to a project (written back in 1.4) I've come up with a number of errors and of course syntax appears to have changed over the years. I intend to go ahead and port it to the newer version of Java and could use some syntax referances. Additionally One warning comes up recurringly upon debug. "Switch statement contains no 'default'"
for example
Code:
public gameFrame(int server, int mode) {
super(" game ("+windowcount+")");
windowcount++;
p = new gamePanel(this, "file:/"+System.getProperty("user.dir")+System.getProperty("file.separator"), false, server, null);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
int tx = d.width/2-320;
int ty = d.height/2-240;
if (tx<0)
tx=0;
if (ty<0)
ty=0;
switch (mode) {
case 0:
w = new Window(this);
w.add("Center", p);
w.resize(640,480);
w.move(tx,ty);
move(tx,ty);
w.show();
p.start();
show();
break;
case 1:
add("Center",p);
//resize(586,441);
move(tx,ty);
show();
fullscreen=false;
p.resize(640,480);
pack();
p.start();
}
setIconImage(p.GetImage("gameicon.gif"));
}
Do you now have to declare a default value for switch statements and if so what's the syntax for doing so?
Last edited by Hack; 12-12-2007 at 09:18 AM.
Reason: Added Code Tags
-
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
I don't know that I would call using J# "using Java".
Was the message you received (no default for switch) an error or a warning? While it is good practice to include a default, and I can't imagine not doing so, I do not expect the compiler to refuse to compile a switch structure that does not include a default condition.
-
J# is not an option to develop java applications, are you migrating into .NET ?
-
 Originally Posted by mr1yh1
J# is not an option to develop java applications
Why not?
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
- J# is not compiled into java byte-code but .NET's MSIL.
- J# does not implement whole java-2 class libraries,
there is not any guarantee (and any reason such a guarantee)
for completeness or compatibility,
since microsoft does not target any java virtual machine.
-
 Originally Posted by mr1yh1
- J# is not compiled into java byte-code but .NET's MSIL.
- J# does not implement whole java-2 class libraries,
there is not any guarantee (and any reason such a guarantee)
for completeness or compatibility,
since microsoft does not target any java virtual machine.
Ah...Ok. Thanks.
Then what would you use J# for?
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
J# can be used when you want to develop Windows applications using Java language without the Java framework and without byte code. You can either get the end product as either as an exe or the .Net MSIL. It can be used instead of VB.Net or C#.Net basically, or to complement / supplement code written in these languages with Java. The only thing (I believe) that is common to Java and J# is the language syntax and some of the libraries.
-
Thanks for the explanation.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
Similar Threads
-
By semidieu in forum .NET
Replies: 2
Last Post: 04-12-2005, 04:46 PM
-
By crypto85 in forum .NET
Replies: 4
Last Post: 02-18-2005, 07:15 PM
-
By Bob in forum VB Classic
Replies: 2
Last Post: 11-19-2002, 09:56 PM
-
By Eric Harris in forum VB Classic
Replies: 2
Last Post: 04-21-2002, 01:03 PM
-
By Dan Barclay in forum .NET
Replies: 90
Last Post: 03-09-2001, 07:04 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks