Learn different Java technologies without GUIs? - java

I'm pretty much a beginner at programming and I know only basics of VB, Java, and C++ as well. Lately, I was trying to work on my Java by building some very simple desktop apps but I found swing and layout managers to be very frustrating. I know how to make them work and I've done them before (not saying I'm good at them) but doing GUI stuff just makes me want to drop the whole project. I kinda like the way it's done with VB or C#.
Are there any other aspects of Java or Java technologies that I can work on instead of GUI stuff? Or does this mean that maybe I should just go for C# if I'm in to developing some desktop apps?
Thank you!

Sure, start with the server side stuff first.
GUI need not mean Swing. If you're doing web apps, perhaps JSPs using JSTL or Flex will be easier for you.
If you develop web services you can use any UI technology you like, as long as you can make a request with an appropriate client. SOAP or REST, you can decouple the back end from the UI.

I think you can start with programming some command line programs. Yes, they maybe less attractive compared to GUI's, but they're easier to understand and get you the stuffs before you move on to the next stage. I personally don't recommend server side programming for starters because there are way too many stuffs to care about than a simple command line program. My next recommendation would be webapps, if you're interested. Because, believe it or not, it is still the most robust language you can trust on building responsive and complicated webapps.

IntelliJ Idea GUI builder is really good at this.
But exactly for the same reason you fell frustrated Java is best used on the server side.
Implementing webapps, servers, frameworks. There are plenty of tools to play with.
I think it is just matter of patience. Since you come from languages that don't do very well without IDE it is a bit shocking.
Keep trying

As duffymo said you have plenty alternatives to swing such as JSP.
You can also try a different free swing editor such as Form Layout maker, Visual Editor Eclipse or the one included in netbeans (don't know each one you used).
Also you can try this SwiXML - XML representation of GUI. (never used this one, but seems to be quite simple to use).
If you develop AMF/AMF3 or Webservices you can develop your interface in many different technologies...

Related

Most effective server side programming language for web development?

This is more a question of pros/cons between PHP and JAVA.
Iv been doing research, and iv narrowed it down to those two.
And in consideration, id like to go into mobile app dev...So thats +1 for Java.
Time taken to learn the language is not an issue...Just would like to know which is the most effective between the two languages mentioned above.
And on a slight note. Can Javascript work with Java? And what is the real advantage of that?
All answers are appreciated, thanks in advance.
I'm sorry, but PHP and Java are not the only choices. Ruby on Rails and Python's Django framework are both excellent tools for web development. While I haven't used it, Groovy's Grails framework is also very highly reviewed (largely by ex Java programmers). In certain (admittedly obscure) circumstances it's even advisable to do something off the wall like write a CGI program in C. It all depends on what you're trying to do.
Mobile app dev shouldn't influence your choice here, because no matter what web framework you're working with a mobile app is a whole new ball of wax.
So, here's the deal: asking people to compare PHP and Java really won't get you any meaningful answers -- you don't have the background necessary to understand what we'll say. You really need to figure out what you're trying to do before you choose your tool. It's like saying "I'm thinking about building a house, should I use a screwdriver or a hammer?" Here is what I would advise:
Go learn to program. Pretty much any language will do, but I'd suggest something nice like Python or Ruby. Spend a few months getting comfortable with programming first.
Pick a project. Make it something simple. When you know what your project is, pick a tool to use to complete your project. This may involve asking another SO question.
Rinse and repeat. Complete many projects. Once you've finished 5 or 10 web projects you'll be in a position to compare different tools. The more tools you use, the better. I'd suggest you do one in Ruby on Rails, one in PHP, one in Django (a python framework), and maybe even one in Java with JSP.
Once you've got that base of experience come back and ask this question again. You'll actually be equipped to understand the answers. Of course, once you've got that experience you won't need to ask the question because you'll already know the answer.
The one you know.
Some feedback:
Mobile app dev is not necessarily just web development.
Javascript is the language of choice on the web browser and works with PHP, Java, etc. on the server.
In general, one language is not more effective than another.
Seriously, judging by your post, I would advise you to start learning PHP and Javascript.
You already have a web browser so you can start writing javascript now.
As for PHP just install XAMPP from http://www.apachefriends.org/en/xampp.html and after a double click you'll be ready for web development.
After learning what its all about you'll be able to then check out Java and see if it is more effective in what you are trying to do.
Your question really indicate you need to learn alot about web development and programming in general, so I could answer your question but.. I'd recomend you go read up a little.
And in consideration, id like to go
into mobile app dev...So thats +1 for
Java.
How is that +1 for Java? We're talking about server-side languages.. you're not running your server off a phone are you? Sure, you can use Java to build apps in addition to running your website, but that's a different story.
Time taken to learn the language is
not an issue...Just would like to know
which is the most profitable at the
end of all the training.
Neither language will make your site more profitable, but you may be in higher demand with different companies depending on what you know.
And on a slight note. Can Javascript
work with Java? And what is the real
advantage of that?
Well... yes, but that's almost a nonsensical question. You use Java or PHP to produce the HTML that gets sent to the client, and then your JavaScript manipulates that. It's completely unrelated to what language you use server-side.
#comment: I can't really say which is more worth learning. I suppose Java is more versatile in that it has more applications outside the web. PHP is supported by more web-servers though (AFAIK), so you won't have trouble if you need to work on a different server.
I can't fairly recommend one over the other though. I've only used PHP for web, and Java for non-web. I like PHP because it's easy to pickup, easy to use, and all sorts of stuff is built into the language without any includes or anything. Has a big community, so there's lots of scripts you can download. One might argue that it's also a mess of a language, but as long as you aren't all uppity about that sort of thing, it's not really a problem. Java OTH... I don't know. I'm not a Java keener, that's all I'll say :)
Most of the answers here should be able to direct you towards your answer though I would just like to say if you are going to learn a programming language to make Web Apps learn Java, not because this will be the best tool for the job, each job is different, but knowing a full fledged language you will be able to quickly adapt to other languages.
You don't learn a language, you learn the concepts behind programming, then apply them to different languages.
I think you need to outline the context of your question. For example, if you are looking to get a job in IT, then the language that is most asked for in job ads is the one you want. If on the other hand, you have an application in mind that you would like to write, then you need to tell people (without giving away the details) what type of application it is so that they can tell you the most suitable languages/APIs to for that area.
But remember this - there is no such thing as a super programming language that is the best for everything. Each language is suitable for a range of tasks in a range of contexts, and is usually awful for everything else. Without the context of where the language will be used, no-one can tell you which is better.
Stop trying to kill two birds with one stone. There are different tools for different tasks. You can write mobile apps with Java but you can't write web apps with it. You'll have to use a server-side programming language such as PHP, Ruby on Rails, Django (Python), etc.

Adobe Air vs Java for Internet Cafe Time Manager Application

I'm planning to do a little project to expand my knowledge in programming. The application I'm trying to build is an Internet Cafe Manager (I Know there are a lot software out there that is similar to what I'm building.). I had chosen this project since it involves connecting to a network, displaying data and time, and has a client and server version of the application.
Now I wan't to get your opinion on what language and approach do you prefer for me to use. I am thinking I will be using Air or Flex since I have a some experience with flash and I am also a fan of good interfaces of AIR/Flex. Also I am thinking that there maybe some read AIR application I can integrate to rapid my development. Java is also in my list, Two of my programmer friend suggest that I will go for Java, But I don't have any background on java.
What Do you think? Please let me know your opinion.
Thank You!
This is definitely a subjective question but it really depends on what you are most comfortable with. Personally, I feel that the tools for Flex/AIR development are much easier to get started with the those of Java. This is especially true if you are taking about using an IDE for Flex development. Using the Flex framework could definitely allow you to get more done quickly.
Just my opinion.
Java is definitely a useful language but can be a big pill to swallow if you are just starting out.
Hope this helps!

Is XML or XUL the future of Java GUI building?

After spending a lot of time and code on programming in Swing, I thought this can't be state-of-the-art Java GUI building. After not finding a user-friendly visual gui bilder for eclipse I stumbled upon declarative GUI building with XML UI toolkits... and I thought: This must be it! I think it's the right way to go, easy and also close to web-programming.
But after looking around in the web and on SO, I got the impression that it is not very common! Although there are many implementations and APIs, it seems like most of them are kind of dead and had no updates in the last 5 years..
So I wonder: Is my feeling right, that XML is not very widespread for java GUIs? And if so - what are the reasons? Maybe it couldn't become accepted or it has some major drawbacks or people are doing everything in the web instead with fatclients or there are better alternatives, maybe javafx?
I just need to know if it is worth spending time in that area or better look for alternate ways. As I dont read developer magazines I just don't know what the trends in gui building are and which technologies are believed to have a future. But I can't imagine that people still spend so much time on writing nasty swing (or swt) apps.
There new fresh and interesting approach - it uses YAML. Check it out at http://code.google.com/p/javabuilders/
Sun's answer to that seems to be JavaFX.
It has a declarative language for specifying the GUI and there will be builder apps as well.
There is some prototype work going on for e4 (Eclipse 4), which would allow building a GUI by editing an Ecore model and customizing it via CSS.
See this blog post for some details and instructions to try it out yourself.
Five to ten years ago XML was very popular. Although fine to provide some kind of standardisation for transferring data between heterogeneous systems, it's not suitable for programming. It always starts with the easy stuff, and lets declare everything. But any real system requires code. XML then falls down. There is also the problem that XML is a bad syntax for humans, and even languages like Java are easier to read.
On the other hand, there is clearly a need for the rails of GUIs. Naked Objects is the closest reasonable attempt I have seen.
I came to the same conclusions as you about the declarative frameworks out there. It is not worth learning a new GUI syntax unless it's widely supported. XUL as an interface language is widespread, but there is no java rendering framework for it. I'd say HTML+CSS+Javascript and a Servlet container is the best Java platform for GUIs today, but sadly I haven't found a platform independent way to display web pages like a desktop application.
If you use Eclipse, you can now use WindowBuilder to help you in creating Swing apps in a user-friendly visual GUI builder. It's now available as a free download, and Google has donated the Swing GUI builder framework to the Eclipse Foundation.
I'd second Thilos suggestion with javaFX.
Additionally the trend is pointing to webapps, so I think that in the long run javaFX and web based UIs will catch up to swing+swt GUIs.
I do all my swing stuff by hand and none of my application is nasty. If you do not know how to create usable and good looking UI there is no technology to help you.
The answer is surely not going to be XML. What problem are you trying to solve? You want to have reusable building blocks, and a compact way of describing them. I don't see XML helping you there.
[edit] Creating a java code equivalent of XUL would be an immense improvement on XUL.
XML makes it really, really hard to do good separation of concerns and once and only once. It is however perfect for the mongolian horde approach. You need a layer on top of swing, it only provides the building blocks.

Has anyone used "GWT Designer"?

Haven't seen anything about it here but it seems to solve one of the problems with GWT - the fact that you have to write Java code to generate your GUI. Instead this software allows you to design the GUI using drag-and-drop tools - a WYSIWYG interface.
I'm not trying to sell the product, by the way.
I just want to know whether it works as advertised, is effective, easy to use, etc?
Anyone have any experience to answer these questions?
GWT-Designer is now freely available as the product has been acquired by Google. http://googlewebtoolkit.blogspot.com/2010/09/google-relaunches-instantiations.html
Google will improve the product which is already quite good.
I don't think that the lack of a GUI editor is a problem with GWT. Consider HTML, there are plenty of WYSIWYG editors for that (like Dreamweaver) but most experienced web designers don't touch that stuff with a barge pole, they hand code it. Not because they're masochists, but because they want control over the source, they want to make it clean and readable. Coding is a scientific artwork, best left to Human Beings ;)
I tried GWT Designer very early on, and I found that it was fairly poor (and only worked on Windows because it had some dlls that went along with it), but things may have changed drastically since then.
I'm using GWT Designer for my Capstone project. I did start from scratch, and it worked quite well. I'm no fan of WYSIWYG software, so I was pleasantly surprised. Here's a link to a post I did on it:
http://benarchie.blogspot.com/2010/12/gwt-designer.html
GWT-Designer is getting better all the time. Give it another look some time, it's catching up to things like visual studio in my opinion.
Personally I like GWT Designer for Eclipse and it is free.
It is a rapid development tool. Not a solution for non-programmers however it will accelerate a Java coders ability to learn how to use the GWT API. Once you learn the tool it will reduce coding time.
I found it necessary to frequently switch between code and WYSIWYG editor to get things exactly how I wanted them. The two editors work well together. You will still need to refer to Java Docs to gain a full understanding. Most of the Java Docs have excellent Java and UiBinder code examples in them which are ready to cut and paste.
Creating GUIs in UiBinder is definitely the way to go because it simplifies the hierarchical nature of laying out GUI elements. The API is missing some information about how to hand code in UiBinder however between GWT-Designer, Java Docs and Google, you will find an answer.
The built in Jetty web server also simplifies deploying and testing on your local machine. I was able to make small code changes and see the effect in the web browser immediately.
Try these tutorials.
http://code.google.com/eclipse/docs/gwt_uibinder.html
http://code.google.com/webtoolkit/tools/gwtdesigner/tutorials/stockwatcher.html
I've tried GWT Designer recently. It still looks poor. If you don't want to lose flexibility, I would recommend to use GWTLab
Just tried it then. Most of my ui.xml files wouldn't open because it doesn't currently support #UiField(provided=true).
The ui.xml files that didn't use this feature would often crash with things like UnableToCompleteException.
Maybe if you started from scratch using designer you might have more luck.
I had a year's subscription but did not renew it, being a bit disappointed with the product.
1) The designer injects all Java code adding creation/property setting/event handling to the module you are building in a most unecomic way. Additionally, it is pretty difficult to modularize the application. Compared to Flex, for instance, the number of lines of code gets easily double or triple in a module and seeing the forest from the trees is not easy.
2) Web applications I built only a a couple of years ago CEASED WORKING possibly due to changes in Javascript engines. That was something I did not expect and is very possibly GWT's fault.
3) The GUI designer needs A LOT of CPU power and so does the build phase.
The concept is nice, however, I admit and GWT designer is the only of its kind. The feeling of difficulty in modularizing may well be my lazyness.
EDIT: Shortly after I wrote the above comment Instantiations/Google introduced the UiBinder concept which makes a lot more sense than the original amalgamation. Now it is a lot more professional.

What's the definitive Java Swing starter guide and reference?

Obviously the Java API reference, but what else is there that you all use?
I've been doing web development my entire career. Lately I've been messing around a lot with Groovy and I've decided to do a small application in Griffon just to experiment more with Groovy and also break some ground in desktop development. The only thing is I'm totally green when it comes to desktop apps.
So, world, where's a good place to start?
The Swing Tutorial is very good. Apart from that, the Swing API is obviously the reference, however it's also a treasure trove of fairly good source code! Add the API source to your IDE and you can jump directly to the implementation to all the Swing classes. This is a great way to explore the functionality, see how various Swing components work and learn a good Swing "style". Furthermore, it's great to be able to step through the API classes if things don't seem to work and you have no idea why! Adding the API source to the IDE has the additional benefit that you get all the JavaDocs along with it, although all modern IDEs can also pull them from the net -- you do not want to program desktop Java without the documentation available from within the IDE!
NetBeans and other IDEs do make the creation of IDEs very easy, but be aware that there is a lot more to Swing than just containers and layout managers. In fact, containers and layout managers are among the easier things, and I'd recommend learning to use them by hand, too. There is nothing at all wrong with using a GUI builder, but in some cases it's overkill, and then it's nicer to just quickly whip up a GUI from source. In other cases you need to be able to create a GUI dynamically and then GUI builders are no use at all! For creating very complex layouts from source, I recommend FormLayout, which has its own set of quirks, but which does scale (in terms of programming effort) to very big frames and layouts.
If you've only done Groovy so far, you'll be surprised how well documented Swing and the rest of the Java API is and how well everything is integrated. It might also take some getting used to a different style of programming, using the debugger more often and println-debugging less, etc. There might also be some "boiler-plate" code that will be very annoying. ;) Enjoy.
The Sun Java tutorials are pretty good. I cannot vouch specifically for the Swing one as it has been ages since I've done any Swing development and I have not read it myself.
Creating a GUI with JFC/Swing
When it comes to developing java desktop applications, I would highly recommend using the IDE environment Netbeans. Especially when it comes to the development of Swing based applications.
I recommend you to play around with netbeans. It will allow you to build complete GUIs using only your mouse. Once you get familiar with Swing components, start using the Java API. Thats how I started.
The O'Reilly Swing Book is a pretty good reference, it has a good overview of general Swing concepts and covers each of the major classes. I used it recently when I had to refresh my memory on Swing.

Categories

Resources