Using WindowBuilder + Scala, any good ideas? - java

I have here a small Scala console application and its working fine. I have now just one trouble: this application should be extended. One of the requests are, that there should be a GUI (AWT,SWT, Swig - doesnt matter, it just have to run on windows).
Well I really dont want to write my own GUI. I like tools like the WindowBuilder. Can I combine this effective? If I would create the GUI with the editor, I'll get generated Java code right? Could this be a problem? I just have to create a Mixin-Project, build the GUI and for each GUI element (Button or whatever with a listener) allocate a scala function. So I dont have to rewrite any of the scala stuff, just point to the function. Is this how it could work? Any suggestions? Thank you
Edit: For me it looks dirty to generate java code in a scala application, but well as I see there is no other solution.

I've done this several times and see no problem with mixing Java and Scala code in one project.
To make things easier for Scala compiler don't put Java and Scala classes into the same package.

Related

Setting a default starting file for Eclipse

I am learning to use a programming language based on Java called Processing that's basically a library. While it comes with it's own IDE, I find too minimal and basic, so I wish to use Eclipse instead.
While I have been able to get it to work, it's a whole lot of hassle to import the library everytime I start a new project, and I was wondering if it's possible to set some sort of default starting "skeleton" for Eclipse where everything is already loaded and ready to go.
Thanks in advance!
While you can create an eclipse template, it's worth trying the Proclipsing Processing plugin.
On top of creating Processing projects it makes it easy to manage/import Processing libraries and (hopefully still) generate applications.

How to edit GUI designer from java class, since i can't find the ".form" file?

I opened a Form application source in IntelliJ, but i can't find the ".form" file, there are just java class. I want to know whether i could open it's GUI designer, and how?
but i can't find the ".form" file, there are just java class
You need to learn how to create GUIs, without the 'GUI designer' of an IDE. That's right, you'll need to actually learn Java. (Shock, horror.) GUI designers work better once you can code a GUI in pure Java, in any case.
I want to know whether i could open it's GUI designer,as figure 2, ..?
No. Most Java code for GUIs don't have an associated .form file.

How do I use existing raw java code in a new Netbeans GUI Builder

I have some existing hand written GUI code that I wrote in a text editor the hard way. It eventually compiled nicely but now I want to use the GUI builder in NetBeans v7.3 to make some extensive improvements. I cannot for the life of me find any information on how I can load/interface my .java file into the NetBeans IDE GUI Builder. Can anyone steer me to a solution or maybe suggest some keywords? Thanks...
Create a Project in NetBeans then Copy those .Java files into your Package. MAke Sure PAckage name is Correct. Now you can run the GUI from NEtbeans without any Issue. But If you want to use the Designer Mode of Netbeans you need to Create the JFRAME from Netbeans toolbox. Else all there will not be any Issue.
If you have prewritten GUI code that wasn't generated using NetBeans, it's practically impossible to edit it using NetBean's view editor. With that said, you have a couple options. If you designed your application using an MVC approach, then mocking up another view isn't too bad given that your controller and model are independent of the view (for the most part). If your GUI is pretty complex, then I would suggest continuing the project by hand. The GUI builder doesn't really have any benefits other than allowing the developer the ability to mock up designs in a faster manner.

Java Code Cleaner

Anyone recommend a good code cleaner for Java. If it had a Netbeans plugin, that would be awesome. Just looking for something simple.
Put variables and functions in order based off scope.
Format the code (Hungarian style)
A really awesome feature would be if it could group together functions that implement a interface for a class.
If you use Alt+Shift+F in Netbeans, it should clean it up for you automatically. You can set preferences within Netbeans as well.

Is there any program like LINQPad for Java?

I've found LINQPad to be extremely useful when answering StackOverflow questions for C# or VB.NET. It allows me to write up some quick code, run it, and (if I want) see a nicely-formatted dump of the results. That way I can be sure that the code I post actually runs. Thus far I haven't seen anything that I can use to achieve the same result with Java. Is there anything like that out there?
I am not looking for something to query data sources; I just want a light-weight IDE. These are the features I'm particularly interested in:
The ability to write and run short snippets of code without establishing a whole project or file structure.
Reporting of compiler and runtime errors in the code when it is run.
The ability to add references to a particular editor instance.
Syntax highlighting and Autocomplete/Intellisense would be a plus.
JPad - A java scratchpad for running snippets
Since I also couldn't find one I've decided to write one. Currently it can:
Run java snippets (no class / imports / public blah... needed).
Contains drivers for MS/MySQL/Postgres.
Output results as HTML tables
It's very rough but I will add to it over time. Feedback is definitely welcome.
This may help : http://www.browxy.com:9000/codeRunner
EDIT: Url seems to have changed to http://www.browxy.com
You can use the Groovy web console ; it's possible to speak java in groovy land.
Java Snippet Runner:
Does something similar to Linqpad (jar file, not just for macs)
http://mac.softpedia.com/get/Development/Java/Java-Snippet-Runner.shtml
Code Runner (Commercial):
for Mac's only, it'll run code snippets in Java, and lots of other languages too (e.g. Objective C)
http://krillapps.com/coderunner/
http://ideone.com is an online service that has the features you want.
I've been using JEdit for a long time, which is a very powerful cross-platform editor, NOT an IDE. It does have plugins to execute Java code right in the editor, and even uses BSH for macros.
I was looking for a "Java LinqPad" also, and i came across :
this
I've been using IntelliJ IDEA and it works really well as a Groovy scratchpad. The Community Edition is free too.
You need to create a new project, but then can add Groovy scripts to it and run them on the fly. Not had any luck with the actual Scratch File functionality though.
Being a Jetbrains editor it's pretty slick too. (Unlike some of the other options)
Nothing beats LinqPad though.

Categories