📄 accessibilitydemo7.java
字号:
// AccessibilityDemo7.java
import javax.accessibility.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class AccessibilityDemo7 extends JFrame
{
AccessibilityDemo7 (String title)
{
super (title);
addWindowListener (new WindowAdapter ()
{
public void windowClosing (WindowEvent e)
{
System.exit (0);
}
});
JPanel p = new JPanel ();
p.setPreferredSize (new Dimension (200, 200));
JTable jt = new JTable (10, 3);
p.add (jt);
getContentPane ().add (p);
pack ();
setVisible (true);
}
public static void main (String [] args)
{
AccessibilityDemo7 ad7;
ad7 = new AccessibilityDemo7 ("Accessibility Demo7");
try
{
Thread.sleep (5000);
}
catch (InterruptedException e) {}
ad7.dumpTableInfo (ad7.getAccessibleContext ());
}
void dumpTableInfo (AccessibleContext ac)
{
AccessibleTable at = ac.getAccessibleTable ();
if (at != null)
{
int nCol = at.getAccessibleColumnCount ();
System.out.println ("Columns = " + nCol);
int nRow = at.getAccessibleRowCount ();
System.out.println ("Rows = " + nRow);
return;
}
int nChildren = ac.getAccessibleChildrenCount ();
for (int i = 0; i < nChildren; i++)
dumpTableInfo (ac.getAccessibleChild (i)
.getAccessibleContext ());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -