java中轻松实现界面跳转(Easy interface jump in Java).docVIP

  • 6
  • 0
  • 约1.07万字
  • 约 19页
  • 2017-08-31 发布于河南
  • 举报

java中轻松实现界面跳转(Easy interface jump in Java).doc

java中轻松实现界面跳转(Easy interface jump in Java)

java中轻松实现界面跳转(Easy interface jump in Java) If such a situation, we use the javax.swing package to build the system interface, the interface is based on the BaseView, he is a container, of course he should provide access control element function, like buttons, drop-down box, table, of course, is just a container, we deploy all elements of the interface in JPanel. Describe as: An interface is a BaseView, which contains only one JPanel, which contains JPanel, including all of our Swing controls, such as JButton, JLable, and so on. The question arises: we usually need to complete a business because the interface will automatically jump to the next interface, a complete interface and can jump back (P.S. because our operation is based on the GUI, so often can save Session information, and Web do not), which is often a system to achieve a factor of low efficiency in the process, I will see my current system used in a judgment on 600 lines of code interface should be which one to jump over, because many interfaces can jump to the current interface. Of course, theres a way to include variables that point to the last interface in the next interface class, which we say is inconvenient and dependent, which is bad for software. Next, I give my solution, and I hope it will be beneficial to friends who use this interface structure. (all of the following are described in simplified models.) 1., simply, lets assume that BaseView inherits JWindow, and of course it can be other containers (depending on your implementation), presumably like this: Public, abstract, class, BaseView, extends, JWindow{ ... (to achieve some interface control and interface information) } 2. each interface class is defined like this: Public, class, MyView, extends, BaseView{ JPanel myPanel; Public, void, playoutPanel () { JButton myButton = new JButton (OK); MyPanel.add (myButton); ...... (add the controls and layout you need to myPanel.) } } 3. assume that there are other interfaces OneView, TwoView, ThreeVi

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档