Hey guys,
I'm about to start a project in which I'll have to implement something simillar to an ordinary excel sheet, and one of the aspects that will be focused is related to the creation/implementation of Macros which allow me to record a number of actions and then perform those actions at any time by clicking on an action button.
I've been spending the whole day looking up for information that may help me with this, and I would like to read your suggestions if possible.

Therefore if you have worked on something simillar I would be really pleased if you could offer me me some tips so I can start thinking on what to do from here on.

Thanks in Advanced

Edited 4 Years Ago by Diogo Martinho

I don't think that the Java language has macros.

Can you define what you mean by a macro? My definition is a source construct that generates different code base on parameters passed to the macro.

What you are asking about sounds like recording of a script that can be played back later. The Robot class would be useful in the play back part.

Yeah it works like a recorder.
Every mouse and keyboard action would have to be recorded and saved in a log file so that I could just run that log file later.

This is easier if you implement a full MVC (model-view-controller) architecture. In that case the controller handles the "logical" meaning of the user input by performing the appropiate method calls to the model (your spreadsheet). It's a bit tedious, but not difficult, to create a log of the calls that were performed, and to "replay" the log by makoing the same calls later... it depends how clever or comprhensive you want it to be.

This article has been dead for over six months. Start a new discussion instead.