Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

swing or javafx or ?  RSS feed

 
jason scotsman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi expert people!

i do not have any experience in GUI in Java and i suddenly have a task to create an application that performs the following:

users should be able
1) to draw initial rectangle area
2) place or draw and be able to move, rotate and scale smaller rectangles on the first area
3) for every smaller rectangle it should be possible to assign two numbers
4) place or draw some kind of connection lines between rectangles (roads) (should be possible to set width of the connection line)

the application should be able
1) return the area of the first big rectangle and area of every smaller rectangle
2) return the total area of the connection roads
3) return the assigned two numbers for every small rectangle
4) return the exact position of every smaller rectangle and distances between them

so, the question is - is Swing a good choice for that, should i look into JafaFX for instance or something else?
i would be glad to receive any tips and thoughts on how to achieve that)
might be you can advice me some good books on Swing or 2D graphics in Java.

thanks a lot!
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at your requirement
jason scotsman wrote:
users should be able
1) to draw initial rectangle area
2) place or draw and be able to move, rotate and scale smaller rectangles on the first area
3) for every smaller rectangle it should be possible to assign two numbers
4) place or draw some kind of connection lines between rectangles (roads) (should be possible to set width of the connection line)

the application should be able
1) return the area of the first big rectangle and area of every smaller rectangle
2) return the total area of the connection roads
3) return the assigned two numbers for every small rectangle
4) return the exact position of every smaller rectangle and distances between them


It looks like you need a canvas or similar allowing the users to draw/ interact with. Is rectangles the "only" thing they can draw?
Whatever the user draws, the program needs to find the connection points, lines, areas etc?

Feels like a drag and drop app or MS Paint look-alike.
 
jason scotsman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K. Tsang wrote:Looking at your requirement
jason scotsman wrote:
users should be able
1) to draw initial rectangle area
2) place or draw and be able to move, rotate and scale smaller rectangles on the first area
3) for every smaller rectangle it should be possible to assign two numbers
4) place or draw some kind of connection lines between rectangles (roads) (should be possible to set width of the connection line)

the application should be able
1) return the area of the first big rectangle and area of every smaller rectangle
2) return the total area of the connection roads
3) return the assigned two numbers for every small rectangle
4) return the exact position of every smaller rectangle and distances between them


It looks like you need a canvas or similar allowing the users to draw/ interact with. Is rectangles the "only" thing they can draw?
Whatever the user draws, the program needs to find the connection points, lines, areas etc?

Feels like a drag and drop app or MS Paint look-alike.


yeah, rectangles only and kind of roads to connect it.
these roads or connections are not that important, could be schematic or made by another rectangle with smaller width for simplicity.
in the end, when everything is places and moved, only areas of every placed rectangle are needed and total area of roads.

cheers mate, i will look into basics of simple graph editors and may be some drag and drop app examples)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!