QuestionsIn each of the following questions, choose the layout manager(s) most naturally suited for the described layout. Assume that the container controlled by the layout manager is a Show Question 1. The container has one component that should take up as much space as possible a. Answer 1: d. Question 2. The container has a row of components that should all be displayed at the same size, filling the container’s entire area. a.
Answer 2: b. This type of same-size layout — whether in a row, a column, or a grid — is what Question 3. The container displays a number of components in a column, with any extra space going between the first two components. a. Answer 3: b. Question 4. The container can display three completely different components at different times, depending perhaps on user input or program state. Even if the components’ sizes differ, switching from one component to the next shouldn’t change the amount of space devoted to the component. a. Answer 4: c. ExercisesExercise 1. Implement the layout described and shown in question
1. JPanel p = new JPanel(new BorderLayout()); p.add(createComponent("Component 1"), BorderLayout.CENTER); frame.setContentPane(p); Exercise
2. Implement the layout described and shown in question 2. JPanel p = new JPanel(new GridLayout(1,0)); p.add(createComponent("Component 1")); p.add(createComponent("Component 2")); p.add(createComponent("Component 3")); p.add(createComponent("Component 4")); frame.setContentPane(p); Exercise 3. Implement the layout described and shown in question 3. JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS)); p.add(createComponent("Component 1")); p.add(Box.createVerticalGlue()); p.add(createComponent("Component 2")); p.add(createComponent("Component 3")); p.add(createComponent("Component 4")); frame.setContentPane(p); Exercise
4. Implement the layout described and shown in question 4. ...//Where the radio buttons are set up: for (int i= 0; i < strings.length; i++) { ... rb[i].setActionCommand(String.valueOf(i)); ... } ...//Where the panel to contain the shared-space components is set up: cards = new JPanel(new CardLayout()); for (int i = 0; i < strings.length; i++) { cards.add(createComponent(strings[i]), String.valueOf(i)); } ...//In the action listener for the radio buttons: public void actionPerformed(ActionEvent evt) { CardLayout cl = (CardLayout)(cards.getLayout()); cl.show(cards, (String)evt.getActionCommand()); } Exercise 5. By adding a single line of code, make the program you wrote for Exercise 2 display the components from right-to-left, instead of from left-to-right. Answer 5: You can change the horizontal orientation using the
p.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); What is a disadvantage of the grid layout quizlet?Identify a disadvantage of grid layouts used in the design of retail stores. these layouts have tall shelves that limit customers' line of sight to only the products displayed in the aisle they are in. Identify a feature of signage.
What is the advantage of the free form layout to the consumer?Advantages: Its ease to be used in small stores where customers wish to browse, amicable working for same type of merchandise, provision of flexibility and visual appeal to customer in intimate relaxed environment are some of the advantages of free form. Free form layout is shown in Fig.
Which of the following is not an objective for a store design?Question: Question 6 1 pts Which of the following is NOT an objective for store design? Implement the retailer's strategy.
Which of the following statements does not describe a benefit of markdowns for a retailer?Which of the following statements does not describe a benefit of markdowns for a retailer? it is a way to gain a higher gross margin.
|