Eclipse could not import .class files for which i dont have the source code.

Just like with JBuilder, I have problem using class files that i do not have the source code for since in the source directory I will get errors saying the classes do not exist. In JBuilder the class files got deleted when JBuilder compiled plus run giving the classic “canon error sound” at runtime.

In eclipse it did not even find the .class files (it was the OGG files I am using). This must be a common problems because using class files without needing the source file is vital amongst communities sharing code.

  1. How do i import .class files that do not have a source code into my Eclipse project?

  2. PFFFFT, I created a project in Eclipse but I cannot see any design mode GUI Classes like in JBuilder. Is there any way of or do I actually need to write the code for all UI myself (no cannot be true???) which will take forever?

  1. Why do you have raw .class files? Either you should have the source to compile them yourself, or they should be distributed within a jar file. Give the library author a slap and tell them to do a proper job. :wink: If you need something straight away, I’d be inclined to jar them up yourself and reference that within your eclipse project.

  2. Eclipse doesn’t have a built-in GUI designer, but theres at least one good plug-in to do that, have a poke around the eclipse website for it.

(Who uses gui designers anyway? Code generation is a design smell).

They were in jar files, it was me extracting them to folders, which I apparently should not do :smiley:

Orangy, pls tell me this is a joke or a nigthmare, ppl write all the GUI code manually? Seriously, having 10-15 screens in a game would take months to write code for if not having any visual editor to place the components.

Seems to me like just a giant waste of time to place every little JButton, JLabel, JPanel and all the nasty gridbaglayout modifications manually.

By the way, I have now tested to import them as archive , the jar files I had. Now Eclipse find the com.jcraft.jogg and the com.jcraft.jorbis packages like intended but it does not find the .class files inside the jogg and jorbis lowest level folders so I get the same problem. Oh boy, should not importing .class files be easy to do without the compiler complaining for errors?

http://www.eclipse.org/vep/WebContent/main.php

visual editors never saved me time, useable for prototyping though.

I would rather write my gui as a xml file by hand (just like a math text with Latex) than to use a visual editor. This kind of things are the most inflexible and cumbersome tools one can have for designing java guis.

Does that also work well if you have many combinations of panels, i.e say you have one place on the screen where you will place either panelA, panelB or panelC , meaning that i cannot just design a whole screen but need to go down to designing panels that are interchangeable.

Most GUI designers I find are clunky and spit out horrible code. It’s much easier and quicker to just do it manually by hand. Of couse I also think that most of the time GridBag layout is totally over the top and unnessisary.

And no-one uses Swing for a game UI anyway, due to it looking like arse.

todate i have never used gridbag layout… probably because i am lazy :slight_smile: I seem to only use border layout and flow layout.

Swing BoxLayout saved my life.

Kev

Just been through our commercial app and replaced all the gridbags with custom layout managers. Much more control, much faster layout too - noticeable on slower machines.

Cas :slight_smile:

[quote=“zappsweden,post:6,topic:28720”]
Of course it does, just write as many xml layout files as you need.

Check out this stuff. Its a layout manager that lets us write a xml file with constraints to arrange our components :

The advantage is that making changes to the gui is as easy as editing a xml file.