aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Look and Feel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Look and Feel" Watch "Look and Feel" New topic
Author

Look and Feel

Keenan Staffieri
Greenhorn

Joined: Jul 22, 2006
Posts: 23
Hi, I stumbled upon this this: https://substance.dev.java.net/

Because I was looking for java themes I could use for my apps. What seems odd, amd sorry for my noobishness, but I don't see a download link, and I'm confused, becase I want the Streetlight / Metal Wall Theme in the middle of the page(black).

Helpz
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

On the left hand side of the page, there's a link for "Documents and files." This is the link that, on a site designed by a regular human person, is called "Downloads."


[Jess in Action][AskingGoodQuestions]
Keenan Staffieri
Greenhorn

Joined: Jul 22, 2006
Posts: 23
ok, i need a little help getting this to work

ok i am following this link:
https://substance.dev.java.net/docs/getting-started.html

I have the substance.jar in my classes folder. Here is my code:




Yet, instead of showing the new substance interface, it shows the losey java one. The reason is that for some reason it cant find the class for subtance in the catch. My output box says "Subtance not found" but i dont know where the class file is, because it didnt come with one. I dont know what im support to do to make this compile and work.

ty for help.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

It's a classpath issue. The substance.jar file needs to be in your classpath. Although your classes folder my be in your classpath I don't believe the VM will read a JAR file located in the classes folder. You'll need to run your application with something like...

java -classpath path\to\substance.jar Swingy

or something like that.


GenRocket - Experts at Building Test Data
Keenan Staffieri
Greenhorn

Joined: Jul 22, 2006
Posts: 23
I use JBuilder and the screen looks like this:
http://img126.imageshack.us/my.php?image=1dr4.jpg


These are my paths... are they ok?

and also how would i run the app with what you said, im a little confused about java because it does not make .exe like C language does. I dont know how i am supposed to run the app without compiling it in jbuilder. when i look in my project folder i there is nothing that seem like it "executes" the program in order to add that path.
[ July 25, 2006: Message edited by: Keenan Staffieri ]
Charles Lyons
Author
Ranch Hand

Joined: Mar 27, 2003
Posts: 836
I assume you have a copy of the runtime (JRE) at a minimum. In that case, on your system path you'll have access to the "java.exe" program. That is used to load the JVM and run all subsequent Java code. Java deliberately doesn't compile into native executables - if it did, it wouldn't be portable across all the other platforms (which is its main advantage)!

All programs start at the entry point of the main(String[]) method. If your class Swingy has that main method (as above), you can start it via:However, when you need to use files in a JAR (as Gregg said), you need to name that JAR explicitly*, and you do so by specifying the -classpath (or -cp) switch:Assuming substance.jar is in the current working directory (otherwise replace with the path to the JAR).

As for your JBuilder, I've never used it, but looking at the screenshot I would imagine you need to add the JAR to the "Required Libraries" list.


* I'm still waiting for the day when the Java standard ClassLoader will search out and load all JARs on the path automatically. You can program one yourself using java.net.URLClassLoader as a base; J2EE Web containers do this as standard in order to load JARs installed in /WEB-INF/classes/ for instance. It would be a minor (easy to implement) but very useful feature!


Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / Amazon Amazon UK )
Keenan Staffieri
Greenhorn

Joined: Jul 22, 2006
Posts: 23
Well I just added the substance to the "Required libaries" tab yet their is an excliamtion point, and I dont know what it mean and it does not say anything or why even if hoovered with mouse. I checked the help, and it said if its grey like that, i need to upgrade to JBuilder Enterprise which cost money, and i dont like that. I dont see why this is nessary, i hope i can get interfaces to work without paying anything.

http://img66.imageshack.us/my.php?image=1nd1.jpg

And also here is a sceeen of the jar file:

http://img160.imageshack.us/my.php?image=2ar3.jpg


I went to the java jre 1.5 directory and i saw a "java.exe" but i still am unclear on how to make my program executable.

ty for help.
Charles Lyons
Author
Ranch Hand

Joined: Mar 27, 2003
Posts: 836
I went to the java jre 1.5 directory and i saw a "java.exe" but i still am unclear on how to make my program executable.
You can't 'make' any Java program executable, at least not in the C/C++/.NET compiled sense. The java.exe application is the launcher for the JVM and will start your Java application... there is no other executable. Java code is converted to native commands by a Just in Time (JIT) compiler at run time.

Try this:

1. Make sure all your class files and JARs are in the same directory (if you've used packages ensure you create subdirectories with the correct nesting).

2. Open a command prompt and cd to that directory.

3. Type "java -cp substance.jar Swingy". This should launch your application.

If you need more help on setting up Java applications, I suggest Googling for Java tutorials for beginners - the first chapter or two should tell you how to start Java apps. in this way. After that, any further questions might be better directed to the "Java in General (beginner)" forum.

As far as paying for software upgrades goes, there's one moral I've always stuck by: everything in Java is free (if not open source), if you're prepared to do some manual tasks yourself. Paying for an IDE upgrade isn't worth it... you might consider using the Eclipse IDE instead which is totally free (actually, open source) and worth the investment (in time at least!):

http://www.eclipse.org
Keenan Staffieri
Greenhorn

Joined: Jul 22, 2006
Posts: 23
i know java doesnt compile into executable, i was just saying i saw the path for java.exe.

i typed in the stuff in the command prompt, and i says this when i try the java -cp substance.jar Swingy command. this: exception in thread "main" java.lang.NoClassDefFoundError: Swingy.

I am right in the directory of my program: C:\Practice Programs\Swingy, there are other folders in this such as classes, and classes has the substance jar file and my class file. i try this command in the command prompt in both the direct Swingy directory, and in the classes folders and it always says this. I followed my noob book about command promt but this one isnt working. Swingy compiled just fine in JBuild, AND it of course has a main.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

i typed in the stuff in the command prompt,

And what stuff was that? Here is what I think I'd type to get it to work.


[ July 26, 2006: Message edited by: Gregg Bolinger ]
Keenan Staffieri
Greenhorn

Joined: Jul 22, 2006
Posts: 23
ok, now it says cannot create java virutal machine
i even made sure it was on mannually by opening up an applet on the net.


[ July 26, 2006: Message edited by: Keenan Staffieri ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

You have a space between - and classpath. It should be -classpath.
Keenan Staffieri
Greenhorn

Joined: Jul 22, 2006
Posts: 23
Ok, thank you that worked perfectly and its beutiful.

But I have a long term question for you, before i let all of you go!

Ok, how would I make this so other people could download it and be able to just simply double click on something and the program would run? Kinda like an executable shortcut but for java...

Also another question about path and letting people download it. Ok, if you have sounds,pictures,sprites,ect, that are used by the program in the classes directly, does java automaticcaly "pack" all of those things from the classes folder for other peoples do download? Or must they be included like I do in C language, give them a folder with the stuff in it.

ty
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Originally posted by Keenan Staffieri:
Ok, thank you that worked perfectly and its beutiful.

But I have a long term question for you, before i let all of you go!

Ok, how would I make this so other people could download it and be able to just simply double click on something and the program would run? Kinda like an executable shortcut but for java...

Also another question about path and letting people download it. Ok, if you have sounds,pictures,sprites,ect, that are used by the program in the classes directly, does java automaticcaly "pack" all of those things from the classes folder for other peoples do download? Or must they be included like I do in C language, give them a folder with the stuff in it.

ty


Lots of good questions. All of which have been asked many times over. For simplicity sake, and to give you something to do, look into JAR files. That is how you will package your application. One of the coolest methods I know of for distributing a Java application is Java WebStart. So look into that as well.

Some helpful hints:

A JAR file can be made executable by inluding a MANIFEST file that defines which class contains the main method. You can also define external JAR files that need to be including in the classpath when executed.

The problem you'll run into is the fact that the user will need both your JAR file and the substance.jar file because the class loader won't load a JAR from inside a JAR. (Although you could write one).

Enter Java WebStart which helps solve these problems.
Keenan Staffieri
Greenhorn

Joined: Jul 22, 2006
Posts: 23
ok ill take a look, ill just worry about it more when the time comes i guess

now off to figuring out how to change this... theme... i want darker one
Keenan Staffieri
Greenhorn

Joined: Jul 22, 2006
Posts: 23
Ok, i got back to this, and i now use eclipse 3.2 so i dont have to use command promt to utilize the sunstance look and feel.

Well it works, and the thing actually lets me change the theme as its open, but i want to keep theme default MY WAY to ebony theme. I am having trouble setting the theme because i am not smart.

CODE:



I am viewing this for help:
https://substance.dev.java.net/docs/themes.html

I want to make the ebony theme work with CLASSIC buttons style.
Kirill Grouchnikov
Greenhorn

Joined: Aug 03, 2006
Posts: 10
Hi,

I'm the developer of Substance LAF. Please register to the Users mailing list of Substance [1] and direct your questions there - do not reply to this post. This way you will get the answers straight from the source (although most of the answers can be obtained by reading the documentation and the test applications).

Kirill

[1] https://substance.dev.java.net/servlets/ProjectMailingListList
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Look and Feel