I'm trying to convert a very large (almost 1000 classes) Java application to J# using VS 2005. I have gotten all the classes to compile by using various workarounds for functionality lacking in the MS Java libraries. The application actually runs, and much of the functionality seems to be available. I have two issues (currently) with the Swing implementation:
- The setIcon method on JButton doesn't appear to work properly, if at all. It seems to be implemented, doesn't throw an exception, but no image appears on the button. Is this a known issue
- Is there any good reason why the Microsoft version of Windows look and feel looks less like Windows than the Sun version I would have hoped that running my Java application under .NET would have improved the look and feel on Windows, not made it worse.
- The Swing example given on this web site at http://msdn2.microsoft.com/en-us/library/96etzbdw.aspx has numerous coding errors. I was able to get it to work, but I had to fix a lot of things first. Not a very good "example" for first-time users.

Java Swing -> J# conversion
Seith
Hi,
setIcon for JButton is working for me.I used the following code
import
javax.swing.*;public
class Program extends JFrame{
JButton jbt = new JButton("Click"); public Program(){
jbt.setIcon(
new ImageIcon("IMG_0641.jpg"));getContentPane().add(jbt);
}
public static void main(String[] args){
Program p = new Program();p.setSize(400, 500);
p.show();
}
}
it works for me.If the image given is not in the correct path as well as no image is present with the name.then the scenario mentione by you will happen.
regards,
Thilak
Shubha Iyer
Thanks for your feedback on swing example that you have mentioned. We would look into it.
Thanks,
Varun
DCoulter
Thanks, I tried your example and it worked just fine. That means there's something off in the code I'm working with that is causing this to fail. Now that I know the interface will handle it, I'll figure out what the difference is between this code and the example you provided.
Ram
hugoplatzer