0

Ok, so I am wrapping up my first fully-formed, beautiful, Java program. It's a practice program I've been using to teach myself various concepts. It's an election Ballot program. Essentially the user creates a Ballot, sets up elected offices and the candidates running for those offices, and then hits run, and the program creates a new Ballot window that has all of the information in it.

Everything works perfectly :), but it's led to me having a question that I can't seem to find an answer to online.

The size of the Ballot that is generated (the height not the width) is determined by the size of the longest list of candidates for a particular office. Each new office is another line in the panel, and the panel and the frame respond according. All of this is fine, and the way that it should be.

Problem is, it can lead to some LARGE windows. On my 1080p monitor, it can be nearly the full height of the monitor. And that's NOT an exceptional case, I used real ballots (in this case, the 2012 ballot from my town) as a model, so having this many candidates on a ballot is very normal.

So, after that long story, I'm wondering about best practices when designing windows. The best way to take screen resolution into account and avoid creating problems with a window that might be too large.

Thanks.

craigmiller160
  • 5,751
  • 9
  • 41
  • 75
  • Is it not possible to add a scroll to your window when the window exceeds a particular length? – Andy T Apr 17 '15 at 16:59
  • It is, but I'm trying to avoid that. If this was a real project (it isn't), scrollbars would create tons of lawsuits for an election board. Candidates whose names appear below the scroll would sue claiming harm because they're now less visible (I have some experience in this arena). So I'm really looking for solutions other than that, because I know how to do that. Now, if there is no alternative solution, I'll accept that as an answer too. – craigmiller160 Apr 17 '15 at 17:22
  • What about creating columns for candidate names? – Andy T Apr 17 '15 at 17:24
  • http://stackoverflow.com/questions/3680221/how-can-i-get-the-monitor-size-in-java – BiScOtTiNo Apr 17 '15 at 18:01
  • Logically, it would be impossible to fit an infinitely long list of candidates on a finite height screen. Normally, a scroll bar would suffice to solve said issue but since you've already rejected that, I'd say you can try either fractionally reducing font size with number of candidates to ensure fit **or** rotate your matrix such as candidates are displayed across horizontally to take advantage of long aspect ratio. – initramfs Apr 17 '15 at 18:08

0 Answers0