Java swing và c windows form

11

New! Save questions or answers and organize your favorite content.
Learn more.

I am writing a fat client application that I would ideally like to be cross-platform, but may settle for Windows-only based on the following:

  • I am much stronger in C# than Java (though I have a few years Enterprise Java experience)
  • I haven't done much with either Windows Forms or Java Swing, just toy apps for each, though I'm more comfortable in Windows Forms than Swing
  • I am concerned about the performance of Swing applications (vs. Windows Forms), but I'm wondering if things have improved in the last couple years
  • I am completely open to developing in either platform...no MS or Java snobbery here. In fact, if you want to tell me to do it in Qt, wxWidgets, or something else, I'll listen!

If any of you switched from Windows Forms to Swing, what were the biggest hurdles?

Was the initial appeal of being cross-platform worth it in the end, or would a faster, less flexible Windows-only app have been better?

If you use Java Swing, which IDE do you prefer for drag/drop form layout?

asked Feb 19, 2010 at 22:37

Noah HeldmanNoah Heldman

6,6043 gold badges39 silver badges39 bronze badges

3

It looks like what you want to hear is: "Don't use swing keep with Winforms" so here it goes: Don't use swing. If you feel more comfortable with C# I think that's the only reason you need to go for it.

Swing apps are fast and the whole platform is good enough, but it definitely needs some time to learn it.

If you decide to give it a try, I'll suggest either Netbeas or IntellJ Idea, both have great GUI builders.

But really, just keep with C#

answered Feb 19, 2010 at 23:14

OscarRyzOscarRyz

193k110 gold badges378 silver badges563 bronze badges

Download Netbeans and try to make a simple Swing application in it. The GUI editor is really nice and powerful, and makes it easy to avoid doing the design by hand. You then add functionality with code snippets placed where Netbeans tells you to.

I did at simple "read in Excel sheet to JTable and upload JTable to database" GUI application from scratch in a day. I was planning just to do the GUI in Netbeans and then import it to Eclipse and do the grunt work there, but it was much easier just staying in Netbeans.

Try it, you might like it.

Edit: Regarding the speed of Swing: There has been a LOT of improvements and basically it can be very fast and snappy. The usual problem is for the programmer to create as responsive code for Swing to call to do its things, and there are a few technical things you need to figure out if you run into that issue (basically do heavy stuff on background threads).

answered Feb 19, 2010 at 23:36

I develop a complex low latency GUI in a bank using the Netbeans RCP platform. There are a lot of people using Netbeans. I also work with WinForm devs too.

The WinForm guys have some extremely rich and high performance/low footprint grids and widgets, especially commercial offerings such as Infragistics. Netbeans apps can have large resource footprints so it really needs to be something your customer is spending most of his computing resources on.

If it needs to be lean and interface rich or fast then Winforms is the way to go.

If you want a large library of APIs to build out and maintain a large complex GUI codebase and have the freedom of a completely portable tech stack I would choose Java everytime.

Having said that, Netbeans IDE is appalling! You would do well to visit Geertjan's blog if you go for it.

Check-in your code regularly to a branch when using the Matisse Graphics editor, it often goes nuts and trashes your layouts and fails to undo. The underlying RCP platform dependancy handling -if it gets you in a twist - can be challenging, but still better than OSGi!

Good luck, GUI development isn't as easy as people say!

answered Apr 9, 2011 at 15:34

It's easier to work with Forms because of the better design tools in Visual Studio and the help from msdn and other sources. Swing appears to be slow to start when compared to the Forms. See: http://www.codeproject.com/KB/dotnet/RuntimePerformance.aspx Also today Swing is less used on the desktop than other technologies.

answered Sep 2, 2010 at 3:17

dmihailescudmihailescu

1,54516 silver badges14 bronze badges

Well, of course it is a matter of taste, but for a windows-only environment i would prefer windows forms ( which you theoretically could try to run on other platforms via Mono ) or WPF (which is a best option for a fat client application as far as i am concerned ). I saw a lot of really ugly Swing applications, which are however cross platform. Indeed, with a little extra work you can get almost native look on each platform. You can use NetBeans for drag/drop with Swing.

answered Feb 19, 2010 at 22:51

n535n535

4,9134 gold badges22 silver badges28 bronze badges

One point that none of the other answers has addressed is, what are the end-users of the application expecting? Do they need a cross platform app?

I've had a quick look at the Visual Guide to Swing Components (Windows Look and Feel) and all the components appear to have a Windows XP styling, which may be an issue if your oftware is going to be run on Windows Vista/7 (That said, the Swing library may well re-theme itself when run under Vista/7, but I couldn't find anything that said either way).

answered Feb 20, 2010 at 10:17

RobRob

44.7k24 gold badges119 silver badges148 bronze badges

C# rules...There is no question about C# (.NET) when you want to develop your application fast. As an example you can compare the options (flexibility) of datagrid with the lousy JTable.. I am sure you will not be surprised.

answered May 22, 2012 at 21:16

Femme FataleFemme Fatale

8607 gold badges25 silver badges56 bronze badges

I see people saying use winforms for fast development, what many may not realize is that you cannot apply the model view control design pattern or any design pattern to winforms. Netbeans does not allow one to use design patterns also and it hides the code. If you use java, dont use gui builders, type it by hand. I used both languages and enjoy swing more because I can model the gui code how I want. Winforms does not give you that freedom. Also java has a lot more librarys. It took me a month to learn swing development at a professional level watching an udemy video I bought, get a video.

answered Apr 9, 2016 at 14:28

1