Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

number of Jframes per application  RSS feed

 
c orange
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i need to create a swing app, startup window consisting of 5 buttons to go do different things.

question is: for each action the button is to do, is it normal practice to create a Jframe for
each button's call?

so button 1 calls a class that creates a JFrame with panels, more buttons, tables etc..and has its own dispose() or exit() call.
button 2 calls another class that creates yet another JFrame, also with its own sets of functions and with its own exit call..
button 3 etc..

how many JFrame windows is considered too many to spawn from 1 start window? or is it a normal
practice to spawn a Jframe with each action to perform?

thanks.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sounds like a candidate for a cardLayout

a single JFrame with a JPanel(cardlayout), which contains all your class panels.

much like an installation wizard with next/previous buttons where each button click
shows a different screen
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!