Hi everyone! This is my first post to this forum and I would like to say first that I am glad to be part of a Java community. I have been working for some time on making my own toy virtual machine in Java but I have run into a problem. I want it to be a virtual machine with a virtual console with 80 characters by 25 characters (this number is flexible and not that important) but I can't figure out how to leverage a JTextArea to my advantage here. My question I suppose is this. First, how can I use a JTextArea to keep these dimensions and second how can I adjust the font size to automatically keep these constraints when the JTextArea is resized? I am not opposed to writing my own layout or even using absolute positioning if necessary since this is only for my use at this point so any pointers would be appreciated. Thanks everyone!


LinkBack URL
About LinkBacks
Reply With Quote
I wrote some code based on FontMetrics and trying to resize the font to provide an exact size for 80*25 characters but I have to say I am terrible at math. Here is the code I have so far for my window: