# Using Java in VASSAL

**URL:** <https://forum.vassalengine.org/t/using-java-in-vassal/4341>\
**Category:** Module Design\
**Created:** [October 10, 2011, 11:52pm UTC](https://forum.vassalengine.org/t/using-java-in-vassal/4341 "2011-10-10T23:52:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![StrangeTim](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/strangetim/32/2912_2.png) [@StrangeTim](https://forum.vassalengine.org/u/StrangeTim)\
**Post date:** [October 10, 2011, 11:52pm UTC](https://forum.vassalengine.org/t/using-java-in-vassal/4341/1 "2011-10-10T23:52:05Z")

</div>

Is it possible to write code for a module in JAVA if the VASSAL coding options just aren’t cutting it? I’m learning JAVA and there are some things that I think could be coded using a javascript that would make the module a ton easier and look better too.

---

<div class="post-metadata">

**Author:** ![mkiefte](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/mkiefte/32/25_2.png) [@mkiefte](https://forum.vassalengine.org/u/mkiefte)\
**Post date:** [October 11, 2011, 12:28am UTC](https://forum.vassalengine.org/t/using-java-in-vassal/4341/2 "2011-10-11T00:28:14Z")

</div>

Yes, you can add custom components written in Java but it’s not terribly  
straightforward. Knowledge of VASSAL internals helps a lot.

What did you have in mind?

- M.

On 10 October 2011 20:52, StrangeTim [strang3tim@gmail.com](mailto:strang3tim@gmail.com) wrote:

> Is it possible to write code for a module in JAVA if the VASSAL coding  
> options just aren’t cutting it?
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> Read this topic online here:  
> [vassalengine.org/\*\*forum/vie … 9#\*\*p25979](http://www.vassalengine.org/ **forum/viewtopic.php?p=25979#** p25979)\<[Using Java in VASSAL](https://forum.vassalengine.org/t/using-java-in-vassal/4341/1)  
> \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> messages mailing list  
> [messages@vassalengine.org](mailto:messages@vassalengine.org)  
> [vassalengine.org/\*\*mailman/listinfo/messages](http://www.vassalengine.org/**mailman/listinfo/messages)[http://www.vassalengine.org/mailman/listinfo/messages](http://www.vassalengine.org/mailman/listinfo/messages)

---

<div class="post-metadata">

**Author:** ![StrangeTim](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/strangetim/32/2912_2.png) [@StrangeTim](https://forum.vassalengine.org/u/StrangeTim)\
**Post date:** [October 11, 2011, 12:39am UTC](https://forum.vassalengine.org/t/using-java-in-vassal/4341/3 "2011-10-11T00:39:10Z")

</div>

I’ve done some design and additions to a module, working on the Twilight Imperium 3rd Edition: Shards of the Throne module. It has so very many pieces that I was hoping I could use a javascript to display only the pertinent information for each player on their main map, but to have a separate section of the main map that each player can change to display other information that they want to display. Doing so would help reduce the number of items in the man map window so that the map itself could be enlarged to accommodate players requests.

---

<div class="post-metadata">

**Author:** ![mkiefte](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/mkiefte/32/25_2.png) [@mkiefte](https://forum.vassalengine.org/u/mkiefte)\
**Post date:** [October 11, 2011, 1:01am UTC](https://forum.vassalengine.org/t/using-java-in-vassal/4341/4 "2011-10-11T01:01:30Z")

</div>

You’re going to have a hard time incorporating Javascript. The only  
practical way to develop custom code is to develop custom Java classes.  
However, what you’re proposing sounds pretty radical. Can you think of a  
creative way to just use basic pieces or windows?

- M.

On 10 October 2011 21:39, StrangeTim [strang3tim@gmail.com](mailto:strang3tim@gmail.com) wrote:

> I’ve done some design and additions to a module, working on the Twilight  
> Imperium 3rd Edition: Shards of the Throne module. It has so very many  
> pieces that I was hoping I could use a javascript to display only the  
> pertinent information for each player on their main map, but to have a  
> separate section of the main map that each player can change to display  
> other information that they want to display. Doing so would help reduce  
> the number of items in the man map window so that the map itself could  
> be enlarged to accommodate players requests.
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> Read this topic online here:  
> [vassalengine.org/\*\*forum/vie … 1#\*\*p25981](http://www.vassalengine.org/ **forum/viewtopic.php?p=25981#** p25981)\<[Using Java in VASSAL - #3 by StrangeTim](https://forum.vassalengine.org/t/using-java-in-vassal/4341/3)
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> messages mailing list  
> [messages@vassalengine.org](mailto:messages@vassalengine.org)  
> [vassalengine.org/\*\*mailman/listinfo/messages](http://www.vassalengine.org/**mailman/listinfo/messages)[http://www.vassalengine.org/mailman/listinfo/messages](http://www.vassalengine.org/mailman/listinfo/messages)

---

<div class="post-metadata">

**Author:** ![StrangeTim](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/strangetim/32/2912_2.png) [@StrangeTim](https://forum.vassalengine.org/u/StrangeTim)\
**Post date:** [October 11, 2011, 1:57am UTC](https://forum.vassalengine.org/t/using-java-in-vassal/4341/5 "2011-10-11T01:57:23Z")

</div>

Yes, I am planning on changing what is displayed on the main map in the next release. Going to move a lot of the information to the players private windows, unfortunately what that means is that to see each players information you’re going to have to have many different windows open at one time in order to compare your items to theirs and to what is currently in play on the map. If I could incorporate what I suggested above then each player could do all of that comparing on the main map but all of the information would be kept in the players private windows. Effectively what I want to do is to have multiple boards in the players private windows and have the main map be able to access those boards and display what is on them, possibly with a drop down menu, without having to open multiple windows. Doing so would enable me to have 10 players or more, as requested by users, but only have say, 2 or 3 different boards displayed in the main map, as selected by the player, to reduce 1: the required size of the main map and 2: the clutter on the main map. If that is possible, I’d like to find a way and I would also like to find a way to make it so that players could drag things from the main map into their displayed private window boards on the main map and have them actually be in the private window. The selected boards on the main map would, in effect, BE the boards in the private window until they are unselected.

---

<div class="post-metadata">

**Author:** ![mkiefte](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/mkiefte/32/25_2.png) [@mkiefte](https://forum.vassalengine.org/u/mkiefte)\
**Post date:** [October 11, 2011, 9:21am UTC](https://forum.vassalengine.org/t/using-java-in-vassal/4341/6 "2011-10-11T09:21:20Z")

</div>

It’s not clear to me that you can’t do this with basic VASSAL. Information  
can be displayed as text labels on pieces based on properties which can be  
global. Have you given it a shot?

- M.

On 10 October 2011 22:57, StrangeTim [strang3tim@gmail.com](mailto:strang3tim@gmail.com) wrote:

> Yes, I am planning on changing what is displayed on the main map in the  
> next release. Going to move a lot of the information to the players  
> private windows, unfortunately what that means is that to see each  
> players information you’re going to have to have many different windows  
> open at one time in order to compare your items to theirs and to what is  
> currently in play on the map. If I could incorporate what I suggested  
> above then each player could do all of that comparing on the main map  
> but all of the information would be kept in the players private windows.  
> Effectively what I want to do is to have multiple boards in the players  
> private windows and have the main map be able to access those boards and  
> display what is on them, possibly with a drop down menu, without having  
> to open multiple windows. Doing so would enable me to have 10 players or  
> more, as requested by users, but only have say, 2 or 3 different boards  
> displayed in the main map, as selected by the player, to reduce 1: the  
> required size of the main map and 2: the clutter on the main map. If  
> that is possible, I’d like to find a way and I would also like to find a  
> way to make it so that players could drag things from the main map into  
> their displayed private window boards on the main map and have them  
> actually be in the private window. The selected boards on the main map  
> would, in effect, BE the boards in the private window until they are  
> unselected.
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> Read this topic online here:  
> [vassalengine.org/\*\*forum/vie … 4#\*\*p25984](http://www.vassalengine.org/ **forum/viewtopic.php?p=25984#** p25984)\<[Using Java in VASSAL - #5 by StrangeTim](https://forum.vassalengine.org/t/using-java-in-vassal/4341/5)
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\__ **\*\*** _  
> messages mailing list  
> [messages@vassalengine.org](mailto:messages@vassalengine.org)  
> [vassalengine.org/\*\*mailman/listinfo/messages](http://www.vassalengine.org/**mailman/listinfo/messages)[http://www.vassalengine.org/mailman/listinfo/messages](http://www.vassalengine.org/mailman/listinfo/messages)

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [October 11, 2011, 10:57am UTC](https://forum.vassalengine.org/t/using-java-in-vassal/4341/7 "2011-10-11T10:57:46Z")

</div>

Thus spake StrangeTim:

> I’ve done some design and additions to a module, working on the Twilight  
> Imperium 3rd Edition: Shards of the Throne module. It has so very many  
> pieces that I was hoping I could use a javascript to display only the  
> pertinent information for each player on their main map, but to have a  
> separate section of the main map that each player can change to display  
> other information that they want to display. Doing so would help reduce  
> the number of items in the man map window so that the map itself could  
> be enlarged to accommodate players requests.

Javascript and Java are not the same thing. They’re not related at all.  
You might be able to write some custom classes in Java to do what you’re  
suggesting. There’s no facility for running Javascript from within  
VASSAL.

–  
J.
