r/processing • u/IndicationInitial143 • 9d ago
Beginner help request What do i need to write to have an interactable window
I have an assignment where I want to have like a mini windows computer. I wanna know how I can 'open up new apps', like click on an icon on the 'desktop' and have it open up a new 'tab'. I want to have my main window, open up into a file explorer, and then have different files in the file explorer that open up into different things. but im not sure how to do it. does anyone have any ideas?
3
Upvotes
1
u/LeibnizoverNewton 8d ago
Hello, I'm not an expert when it comes to processing. However, I will say that each the processing IDE is primarily intended to be used in Java mode in which it creates an instance of the PApplet class upon the creation of each sketch. You should try using the Processing extension in VSCode and then create a PApplet using the Processing library and then use Swing from Java's built in JDK (Java Development Kit) to create windows, buttons, and other software application components.
2
u/tuto42 9d ago
That looks a little ambitious, maybe you could start by doing only one of those things first ?
If you want to get good help here I think it will go better if you ask about something more specific, more basic.
But you lucky Im bored out of my mind in an hospital bed so here are some pointers about your specific case :
When creating large software the trick is to break the big problem in many small ones then resolving them individually and then trying to make them work together later.
I was personnaly never able to open multiple windows from the same program with processing alone, at least not in an usefull way, you will have to keep everything in one window.
main window open up into a file explorer :
For this you will need first to learn a proper GUI library, I used ControlP5 a lot and its really good, it has everything you will need. Add the lib to your code and start making small widget and button to test it. Once you feel more confident you will start making your explorer UI design.
have different files in the file explorer :
If you want to create new "file" object inside your explorer and to find them again after restarting your soft you will need to learn about how to store and retrieve data to / from your PC harddrive. You should take a look at the methods offered by processing to read and write to a file. If your objects are complexe I recommend json its powerfull and relatively easy to use.
They open up into different things :
I think you should start by focusing on one thing only, maybe a basic text editor ? If you try to do too many tools at the same time you will most likely get burnout before achieving anything significant.
If you want to ask for help here again later you are always free to do so but please take a little bit more time to explain your needs and what you dont understands, us old farts like long and well written text so we will be more inclined toward helping you if you do so ;)
And lastly, good luck. Programing is hard in itself and your project is really not the simplest.
Tuto out
1
u/R_GiskardOlivaw 7d ago
Hello, I'm not a student anymore but it was also difficult to me to write regular desktop apps with Processing. That's the main reason I made this library:
https://github.com/cdpoloz/cpz-mvvm-processing-controls
You can use it in your project and have controls equivalent to the ones that come with Swing (not all of them) but you can give them a custom style. Personally I don't like Swing because for me it seems old fashioned. There are some basic examples that you can easily modify according to your needs. Just a detail, I use this library within IntelliJ not the Processing IDE. If the documentation is not enough for you feel free to message me with your questions, good luck and keep coding!