コード例 #1
0
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jScrollPane1 = new javax.swing.JScrollPane();
        users = new javax.swing.JList();
        hide = new javax.swing.JButton();
        help = new javax.swing.JButton();
        jToolBar1 = new javax.swing.JToolBar();
        refresh = new javax.swing.JButton();
        kick = new javax.swing.JButton();
        progress = new javax.swing.JProgressBar();
        terminate = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle(L10n.getString("Server.Manage"));
        users.setToolTipText(L10n.getString("Server.ListOfUsersTT"));
        jScrollPane1.setViewportView(users);

        hide.setText(L10n.getString("Server.Hide"));

        help.setText(L10n.getString("Common.Help"));

        jToolBar1.setFloatable(false);
        refresh.setText(L10n.getString("Server.Refresh"));
        jToolBar1.add(refresh);

        kick.setText(L10n.getString("Server.KickUser"));
        jToolBar1.add(kick);

        progress.setBorderPainted(false);
        jToolBar1.add(progress);

        terminate.setText(L10n.getString("Server.Terminate"));

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
                    .add(layout.createSequentialGroup()
                        .add(help)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 167, Short.MAX_VALUE)
                        .add(terminate)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(hide)))
                .add(10, 10, 10))
        );

        layout.linkSize(new java.awt.Component[] {hide, terminate}, org.jdesktop.layout.GroupLayout.HORIZONTAL);

        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(jToolBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(hide)
                    .add(terminate)
                    .add(help))
                .addContainerGap())
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents
コード例 #2
0
	/**
	 * Create a new StandardAction.
	 * 
	 * @param text The base string that will be used to obtain the caption, the tooltip text
	 * and an image from the L10N.
	 */
	public StandardAction(String text) {
		putValue(NAME, L10n.getString(text));
		putValue(SHORT_DESCRIPTION, L10n.getString(text+"TT"));
        ImageIcon icon = Resource.createIcon(text+".gif");
		if(icon != null) putValue(SMALL_ICON, icon);
	}