Debian Codegraph @

tests/com/bulenkov/iconloader/IconLoaderDemoFrame.java

raw symbols SCIP
1 /*
2 * Copyright 2000-2014 JetBrains s.r.o.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package com.bulenkov.iconloader;
18
19 import javax.swing.*;
20 import java.awt.*;
21
22 public class IconLoaderDemoFrame extends JFrame {
23 public static void main(String[] args) {
24 new IconLoaderDemoFrame();
25 }
26
27 public IconLoaderDemoFrame() throws HeadlessException {
28 super("IconLoader Demo");
29 setSize(300, 100);
30 final JPanel panel = new JPanel(new BorderLayout());
31 getContentPane().add(panel);
32 JPanel bottom = new JPanel(new BorderLayout());
33 panel.add(bottom, BorderLayout.SOUTH);
34 JButton disabledButton = new JButton("Print disabled", IconLoader.getIcon("/icons/print.png"));
35 disabledButton.setEnabled(false);
36 JButton enabledButton = new JButton("Print enabled", IconLoader.getIcon("/icons/print.png"));
37 bottom.add(disabledButton, BorderLayout.WEST);
38 bottom.add(enabledButton, BorderLayout.EAST);
39
40 setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
41 setVisible(true);
42 }
43 }