use of javax.swing.JToggleButton in project zaproxy by zaproxy.
the class HttpPanelSender method getButtonFollowRedirects.
private JToggleButton getButtonFollowRedirects() {
if (followRedirect == null) {
followRedirect = new JToggleButton(new ImageIcon(HttpPanelSender.class.getResource(// Arrow
"/resource/icon/16/118.png")));
// turn
// around
// left
followRedirect.setToolTipText(Constant.messages.getString("manReq.checkBox.followRedirect"));
followRedirect.setSelected(true);
}
return followRedirect;
}
use of javax.swing.JToggleButton in project jdk8u_jdk by JetBrains.
the class DimensionEncapsulation method run.
@Override
public void run() {
runTest(new Panel());
runTest(new Button());
runTest(new Checkbox());
runTest(new Canvas());
runTest(new Choice());
runTest(new Label());
runTest(new Scrollbar());
runTest(new TextArea());
runTest(new TextField());
runTest(new Dialog(new JFrame()));
runTest(new Frame());
runTest(new Window(new JFrame()));
runTest(new FileDialog(new JFrame()));
runTest(new List());
runTest(new ScrollPane());
runTest(new JFrame());
runTest(new JDialog(new JFrame()));
runTest(new JWindow(new JFrame()));
runTest(new JLabel("hi"));
runTest(new JMenu());
runTest(new JTree());
runTest(new JTable());
runTest(new JMenuItem());
runTest(new JCheckBoxMenuItem());
runTest(new JToggleButton());
runTest(new JSpinner());
runTest(new JSlider());
runTest(Box.createVerticalBox());
runTest(Box.createHorizontalBox());
runTest(new JTextField());
runTest(new JTextArea());
runTest(new JTextPane());
runTest(new JPasswordField());
runTest(new JFormattedTextField());
runTest(new JEditorPane());
runTest(new JButton());
runTest(new JColorChooser());
runTest(new JFileChooser());
runTest(new JCheckBox());
runTest(new JInternalFrame());
runTest(new JDesktopPane());
runTest(new JTableHeader());
runTest(new JLayeredPane());
runTest(new JRootPane());
runTest(new JMenuBar());
runTest(new JOptionPane());
runTest(new JRadioButton());
runTest(new JRadioButtonMenuItem());
runTest(new JPopupMenu());
//runTest(new JScrollBar()); --> don't test defines max and min in
// terms of preferred
runTest(new JScrollPane());
runTest(new JViewport());
runTest(new JSplitPane());
runTest(new JTabbedPane());
runTest(new JToolBar());
runTest(new JSeparator());
runTest(new JProgressBar());
if (!failures.isEmpty()) {
System.out.println("These classes failed");
for (final Component failure : failures) {
System.out.println(failure.getClass());
}
throw new RuntimeException("Test failed");
}
}
use of javax.swing.JToggleButton in project jdk8u_jdk by JetBrains.
the class Test6817933 method main.
public static void main(String[] args) throws Exception {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
} catch (Exception exception) {
exception.printStackTrace();
// ignore test on non-Windows machines
return;
}
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
StyleSheet css = new StyleSheet();
css.addRule(STYLE);
HTMLEditorKit kit = new HTMLEditorKit();
kit.setStyleSheet(css);
JFrame frame = new JFrame(STYLE);
frame.add(chooser = new JFileChooser());
frame.setSize(640, 480);
frame.setVisible(true);
}
});
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
toolkit.realSync(500);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
try {
JToggleButton button = get(JToggleButton.class, get(WindowsPlacesBar.class, chooser));
int width = button.getWidth();
int height = button.getHeight() / 3;
Point point = new Point(0, height * 2);
SwingUtilities.convertPointToScreen(point, button);
width += point.x;
height += point.y;
int count = 0;
Robot robot = new Robot();
for (int x = point.x; x < width; x++) {
for (int y = point.y; y < height; y++) {
count += COLOR.equals(robot.getPixelColor(x, y)) ? -2 : 1;
}
}
if (count < 0) {
throw new Exception("TEST ERROR: a lot of red pixels");
}
} catch (Exception exception) {
throw new Error(exception);
} finally {
SwingUtilities.getWindowAncestor(chooser).dispose();
}
}
});
}
use of javax.swing.JToggleButton in project zaproxy by zaproxy.
the class SpiderPanel method getShowMessagesToggleButton.
private JToggleButton getShowMessagesToggleButton() {
if (showMessageToggleButton == null) {
showMessageToggleButton = new JToggleButton(Constant.messages.getString("spider.toolbar.button.showmessages.label"), new ImageIcon(SpiderPanel.class.getResource("/resource/icon/16/178.png")));
showMessageToggleButton.setToolTipText(Constant.messages.getString("spider.toolbar.button.showmessages.tooltip"));
showMessageToggleButton.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (ItemEvent.SELECTED == e.getStateChange()) {
showTabs();
} else {
hideMessagesTab();
}
}
});
}
return showMessageToggleButton;
}
use of javax.swing.JToggleButton in project zaproxy by zaproxy.
the class RequestSplitComponent method initUi.
protected void initUi() {
buttonShowView = new JToggleButton(DisplayUtils.getScaledIcon(new ImageIcon(RequestSplitComponent.class.getResource("/resource/icon/view_split.png"))));
buttonShowView.setToolTipText(BUTTON_TOOL_TIP);
panelOptions = new JPanel();
panelOptions.add(headerViews.getSelectableViewsComponent());
panelOptions.add(bodyViews.getSelectableViewsComponent());
headerViews.addView(createHttpPanelHeaderTextView());
splitMain = new JSplitPane();
splitMain.setDividerSize(3);
splitMain.setResizeWeight(0.5d);
splitMain.setContinuousLayout(false);
splitMain.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitMain.setTopComponent(headerViews.getViewsPanel());
splitMain.setBottomComponent(bodyViews.getViewsPanel());
initViews();
panelMain = new JPanel(new BorderLayout());
panelMain.add(splitMain, BorderLayout.CENTER);
setSelected(false);
}
Aggregations