Thursday, May 30, 2019
Layout Design :: essays research papers
Deciding LayoutsDeciding the layout is a very important step in Java GUI programming, just worry solving an algorithm in normal programming. Layout decides how the components like labels, buttons, text fields etc are going to be displayed on a frame or window. several(prenominal) GUI can be designed using single panel with a single simple layout. Some GUI compulsion to be low down into smaller panels which have to be added to an outer panel. Each smaller panel can have 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 desire all the components in a single row.Next is grid layout. As long as you can determine 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 filler labels to occupy the empty spaces. So grid layout works fine in much(p renominal) cases.But if you want to have a very neat GUI with very good layout, you need to go for more than 1 panel. In that case, grid, flow, and redact 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 unsmooth break awaying on how GUI needs to look. flake 1In case 1, you need to start with a paper and pencil.-Read the problem and identify what needs to be displayed to the user-Depending on that, draw a simple draw on how you want your GUI to look-Then start deciding on the layoutFor example, consider the problem below keep 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 discern what to enter in the text fields.2.1 button to initiate calculation.3.1 t ext 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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.