Tuesday, February 5, 2019

Layout Design :: essays research papers

decision making LayoutsDeciding the layout is a very important step in Java graphical user interface programming, just interchangeable solving an algorithm in normal programming. Layout take roots how the components like labels, buttons, schoolbook fields etc are issue to be displayed on a frame or window. few graphical user interface can be knowing using hit panel with a iodin simplex layout. Some graphical user interface destiny to be broken down into smaller panels which expect to be added to an outer panel. Each smaller panel can afford its own layout.The simplest layout is the flow layout. Flow layout produces output as a single row. So go for flow layout if you have only 3 or lesser components or if you motivation all the components in a single row.Next is grid layout. As long as you can meet the rows and columns, you can use this layout. It is possible to use grid layout for most of the applications which you want to develop with a single panel. You can always use makeweight labels to occupy the empty spaces. So grid layout works fine in such oddballs.But if you want to have a very sportsmanlike GUI with very good layout, you need to go for more than 1 panel. In that case, grid, flow, and border are all used together.The development of a GUI depends on the type of problem. There are 2 types of GUI problems1.Problems which just specify that you need to do certain things. In this case, the layout of GUI is totally in your hands.2.Problems where you are given a rough displace on how GUI needs to look.Type 1In case 1, you need to jump with a paper and pencil.-Read the problem and put what needs to be displayed to the user-Depending on that, draw a simple diagram on how you want your GUI to look-Then start deciding on the layoutFor example, consider the problem belowWrite a GUI java program that takes 2 numbers from the user, adds them, and displays the sum.Solution1.For this, you need 2 text fields to read 2 inputs. 2 labels to severalis e what to enter in the text fields.2.1 button to initiate calculation.3.1 text field to display result, and 1 label to address the text field.4.The rough diagram will be5.For the above diagram, if you are going to use a single panel, then grid layout is the best choice. To decide the layout, dissect the diagram as shown below.

No comments:

Post a Comment