(Large-Type Displays for People with Low Vision) The accessibility of computers
ID: 3824543 • Letter: #
Question
(Large-Type Displays for People with Low Vision) The accessibility of computers and the Internet to all people, regardless of disabilities, is becoming more important as these tools play increasing roles in our personal and business lives. According to a recent estimate by the World Health Organization, 246 million people worldwide have low vision. To learn more about low vision, check out the GUI-based low-vision simulation at www.webaim.org/simulations/lowvision.php. People with low vision might prefer to choose a font and/or a larger font size when reading electronic documents and web pages. Java has five built-in “logical” fonts that are guaranteed to be available in any Java implementation, including Serif, Sans-serif and Monospaced. Write a GUI application that provides a JTextArea in which the user can type text. Allow the user to select Serif, Sans-serif or Monospaced from a JComboBox. Provide a Bold JCheckBox, which, if checked, makes the text bold. Include Increase Font Size and DecreaseFont Size JButtons that allow the user to scale the size of the font up or down, respectively, by one point at a time. Start with a font size of 18 points. For the purposes of this exercise, set the font size on the JComboBox, JButtons and JCheckBox to 20 points so that a person with low vision will be able to read the text on them.
Explanation / Answer
/*
This program demonstrates
BorderLayout Manager.
*/
/*
BorderLayout Class Constants:
- public static final java.lang.String
NORTH;
- public static final java.lang.String
SOUTH;
- public static final java.lang.String
EAST;
- public static final java.lang.String
WEST;
- public static final java.lang.String
CENTER;
- public static final java.lang.String
BEFORE_FIRST_LINE;
- public static final java.lang.String
AFTER_LAST_LINE;
- public static final java.lang.String
BEFORE_LINE_BEGINS;
- public static final java.lang.String
AFTER_LINE_ENDS;
BorderLayout Class Constructors:
- public java.awt.BorderLayout();
- public java.awt.BorderLayout(int,int);
* BorderLayout is the default layout
manager for Frame class.
* BorderLayout class implements
LayoutManager2 interface.
*/
import java.awt.*;
class BorderLayoutDemo extends Frame
{
Button b1, b2, b3, b4, b5;
Font f;
BorderLayoutDemo()
{
setBackground(Color.pink);
setForeground(Color.blue);
setTitle("BorderLayout Demo");
setLayout(new BorderLayout(30,
30));
f = new Font("Arial", Font.BOLD, 14);
setFont(f);
b1 = new Button("EAST");
b2 = new Button("WEST");
b3 = new Button("NORTH");
b4 = new Button("SOUTH");
b5 = new Button("CENTER");
/*
add(b1, BorderLayout.EAST);
add(b2, BorderLayout.WEST);
add(b3, BorderLayout.NORTH);
add(b4, BorderLayout.SOUTH);
add(b5, BorderLayout.CENTER);
*/
add(b1);
add(b2);
add(b3);
add(b4);
add(b5);
setSize(400, 400);
show();
}
public static void main(String args[])
{
new BorderLayoutDemo();
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.