Can someone please clarify what "modern" Java is for me?

J

Jeff Higgins

Wojtek said:
dos-man 64 wrote :

Hmmm, the name torrent is already associated with a distributed file
transfer process.

I think you would be better off having your program generate a data file
which contians the commands to reproduce the image, rather than actual
source code. Then you write a plugin which reads the data file and
generates the image.

That way (if it ever becomes popular) others could write plugins in
other languages to read the data file.

I like this one. Simple. Even has a Java implementation.
<http://www.geocities.com/franzglaser/txt/NGpaint.html>
 
M

Mark Space

dos-man 64 said:
Well, here is my "app" right now. All it is is an empty window with
no controls on it (although it took quite a few hours to make it.) I'm
just trying to get the basics down, ie create a window, move it, set
the caption, add a menu, etc.


Sorry, I misunderstood. I thought you had a mis-sized button. You've
already got some decent advice about preventing resizing. It's a shame
there isn't better control for window decorations, but that's what Java
gives us. Most times it's not a worry.

Just a reminder: again, you should probably be using Swing, not AWT.
You'll be happier in the long run.
 
D

dos-man 64

dos-man 64 wrote :


Hmmm, the name torrent is already associated with a distributed file
transfer process.

I think you would be better off having your program generate a data
file which contians the commands to reproduce the image, rather than
actual source code. Then you write a plugin which reads the data file
and generates the image.

That way (if it ever becomes popular) others could write plugins in
other languages to read the data file.

You're talking about something like a generic bytecode or a simple
programming function that could be rewritten in another language?
Something like this maybe

type, shape, rgb(rgb) x, x1, x2, y2, radius

solid, square, red, green, blue, 0, 0, 100, 100, 0

It could work. I've been having thoughts about the program spitting
out a long function call. The user would then need to have the
function in his or her program in order to use the generated code.
This would remove a lot of redundant code (which there is a lot of.)
Unfortunately, It would also make it more difficult to edit the code
(which needs to be done for the purpose of animation.)

Instead of this:

drawwidth = 1
backcolor = 0
circle(0, 10), 0, 0

Would have this

private sub(shapetype, solid, color, x, y, x2, y2, drawwidth)
if shapetype = 1 ' its a square
if shapetype = 2 ' its a circle
if shapetype = 3 ' its a line
if shapetype = 4 ' its text
if solid = 1 its transparent
form1.drawwidth = drawwidth
form1.forecolor = color
' rest of the code for drawing the shape goes down here
end sub
 
A

Arne Vajhøj

Andrew said:
The MS specific classes did cause problems. They both
introduced new security bugs, and made any code developed
to use them, 'IE specific'. I almost bet that whatever
IDE MS offered for Java, had the MS GUI widgets 'drag and
dropable' on an Applet.

Sure.

But early JBuilder's also had Borland specific layouts etc..

It is hard to sue for extra features being added.

Features not being present and still using the trademark
is another matter.

Arne
 
D

dos-man 64

I like this one. Simple. Even has a Java implementation.
<http://www.geocities.com/franzglaser/txt/NGpaint.html>- Hide quoted text -

- Show quoted text -

Interesting, although kind of rough and hard to follow.

Torrent would definitely not generate code that would be compatible
with this program. Unfortunately, all these different programming
languages have drastically different graphics command syntaxes. VB is
the only one that I know of that uses DRAWWIDTH and FILLCOLOR
properties for a form or picture box.

Rapid-Q is somewhat similar, but even that differs in a few ways. The
circle statement in particular is way different, requiring 4 integer
positions (I think)

canvas.circle (x, y, x2, y2, color)

or something along those lines depending on whether it is a painted
circle or not. This radically differs from the following VB code for
an unpainted circle....

fillstyle = vbfstransparent
circle (x, y), color

I can definitely make a version of torrent to generate code along the
lines of the following

unpainted_circle x y radius color
painted_circle x y radius color fillcolor
unpainted_square x y x2 y2 color
painted_square x y x2 y2 color fillcolor
text x y color size bold underline font
line x y x2 y2 color

Would still be horrificly hard to parse this! I wouldn't even attempt
to parse this back into VB code. Be easier to just create a second
version of Torrent, or use a command line argument to instruct torrent
not to generate "pure" vb code.
 
D

dos-man 64

Here is an example of a java.awt.Graphics2D
subclass which 'spits out' Java source code.

<http://java.freehep.org/vectorgraphics/apidocs/org/freehep/graphicsio...>

I'm currently using the VectorGraphics package
to export Postscript from a java.awt.Graphics2D.
Works pretty well.


Yikes. I'm afraid that's way over my head. Java is maybe my "worst"
langauge. I can barely even create a window much less draw complex
video game graphics or animated sequences on it!

At any rate, I have set it up so that it will generate generic tokens
instead of code
using the -TOKENS command line parameter.

LINE x y x2 y2 color drawwidth
TEXT x y color bold italic underline "font" size "value"

Maybe one of these days I'll summon up the gumption to write a program
that converts the tokens into rapid-q or delphi drawing statements.
Maybe.
 
A

Arne Vajhøj

Joshua said:
JFrame == Swing, which is a lightweight toolkit system.
Frame == AWT, which is heavyweight.

That is the traditional characterization.

I believe it is done so because Swing draws controls itself while
AWT call native controls.

But Swing does not seem very lightweight is most senses of
that word.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top