Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Designing forms within an application  RSS feed

 
Robert Waals
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on project called Data Crow. One thing I would like to add is the ability for users to design their own forms. Currently they can determine the field order and which fields are to be displayed. I'd rather allow them to drag and drop components onto a form. I have been looking around on the internet and found some applications like JGoodies and JFormDesigner. These are paid for applications which I will not be able to include in my open source project. Also they are focused towards developers of applications.

Now as to the real questions;
Is there anyone who has experience with drag and drop design for JPanels within an application? Any hints on how to get started would be most appreciated!
 
Robert Waals
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for awakening this old thread but I'd really like to hear some opinions on this plan.
Any comment would be most appreciated!

Robert Jan
 
Mikko Kohtamäki
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I havent tried this yet myself but in near future yes. Dont know will you have much comments for it, so decided to do so. But I think you already know these things what I'm about to tell you

Maybe I create some rectangles with in parent component's boudaries, if I want to set some default bounds for components and listening with MouseInputListener, that in which boundary the cursor is located then maybe draw some borders around the boundary while mouse still pressed. And is there yet component added in that boundary, if so will it be replaced or switching places.

Then add MouseListeners to added components and change the cursor's icon when near its bounds edges to have support for extending it, using preferred size.

And for what comes to LayoutManager I probably will use GridBagLayout.

Then of course I would create class that imlements Transferable and maybe new class that extends from DataFlavor.

In the end I think you have to have default boundaries for the components.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!