Java Code Examples for javax.swing.JTextArea.setOpaque()

The following are Jave code examples for showing how to use setOpaque() of the javax.swing.JTextArea class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: xdman   File: BrowserIntDlg.java   Source Code and License Vote up 7 votes
void createOthersPanel() {
	othersPanel = new JPanel(new BorderLayout(10, 10));
	othersPanel.setBackground(Color.WHITE);
	othersPanel.setBorder(new EmptyBorder(0, 20, 0, 20));
	JTextArea txt1 = new JTextArea(StringResource.getString("BI_LBL_6"));
	txt1.setBorder(new EmptyBorder(20, 20, 20, 20));
	txt1.setBackground(bgColor);
	txt1.setOpaque(false);
	txt1.setWrapStyleWord(true);
	txt1.setEditable(false);
	txt1.setLineWrap(true);
	othersPanel.add(txt1, BorderLayout.NORTH);

	JPanel biPanel = new JPanel(new GridLayout(2, 1, 20, 20));
	biPanel.setBorder(new EmptyBorder(20, 20, 20, 20));

	biPanel.add(btn1);
	biPanel.add(btn2);
	biPanel.setBackground(Color.WHITE);

	othersPanel.add(biPanel);

	othersPanel.add(autoStart, BorderLayout.SOUTH);
}
 
Example 2
Project: FreeCol   File: Utility.java   Source Code and License Vote up 6 votes
/**
 * Creates a text area with standard settings suitable for use in FreeCol
 * panels, without setting its size.
 *
 * @param text The text to display in the text area.
 * @return A suitable text area.
 */
public static JTextArea createTextArea(String text) {
    JTextArea textArea = new JTextArea(text);
    textArea.setOpaque(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    textArea.setFocusable(false);
    return textArea;
}
 
Example 3
Project: VISNode   File: ExceptionPanel.java   Source Code and License Vote up 5 votes
/**
 * Builds the message label
 * 
 * @param exception
 * @return JComponent
 */
private JComponent buildMessageLabel(Exception exception) {
    JTextArea textArea = new JTextArea(2, 100);
    textArea.setText(exception.getMessage());
    textArea.setBorder(null);
    textArea.setOpaque(false);
    textArea.setEditable(false);
    return textArea;
}
 
Example 4
Project: incubator-netbeans   File: OperationPanel.java   Source Code and License Vote up 5 votes
private JComponent getTitleComponent (String msg) {
    JTextArea area = new JTextArea (msg);
    area.setWrapStyleWord (true);
    area.setLineWrap (true);
    area.setEditable (false);
    area.setOpaque (false);
    area.setBorder(BorderFactory.createEmptyBorder());
    area.setBackground(new Color(0, 0, 0, 0));
    area.putClientProperty(JTextPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
    return area;
}
 
Example 5
Project: incubator-netbeans   File: NativeExecutionUserNotificationImpl.java   Source Code and License Vote up 5 votes
private JComponent createMessageComponent(String message) {
    final JTextArea textArea = new JTextArea(message.trim());
    int fontSize = textArea.getFont().getSize();
    textArea.setFont(new Font("Monospaced", Font.PLAIN, fontSize)); //NOI18N
    textArea.setEditable(false);
    textArea.setOpaque(false);
    return textArea;
}
 
Example 6
Project: incubator-netbeans   File: DesignSupport.java   Source Code and License Vote up 5 votes
static JComponent warningPanel() throws MissingResourceException {
    JTextArea a = new JTextArea();
    a.setEditable(false);
    a.setText(org.openide.util.NbBundle.getMessage(BasicSettingsPanel.class, "MSG_ReallyLaunch", new Object[]{}));
    a.setOpaque(false);
    return a;
}
 
Example 7
Project: incubator-netbeans   File: GuiUtils.java   Source Code and License Vote up 5 votes
/**
 * Creates a text component to be used as a multi-line, automatically
 * wrapping label.
 * <p>
 * <strong>Restriction:</strong><br>
 * The component may have its preferred size very wide.
 *
 * @param  text  text of the label
 * @param  color  desired color of the label,
 *                or {@code null} if the default color should be used
 * @return  created multi-line text component
 */
public static JTextComponent createMultilineLabel(String text, Color color) {
    JTextArea textArea = new JTextArea(text);
    textArea.setEditable(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    textArea.setEnabled(false);
    textArea.setOpaque(false);
    textArea.setColumns(25);
    textArea.setDisabledTextColor((color != null)
                                  ? color
                                  : new JLabel().getForeground());
    
    return textArea;
}
 
Example 8
Project: jmt   File: WarningScrollTable.java   Source Code and License Vote up 5 votes
/**
 * Creates the panel to be shown when the table is empty
 * @param msg message to be shown on the panel
 * @return created warning panel
 */
protected JPanel createWarningPanel(String msg) {
	JPanel warning = new JPanel(new GridBagLayout());
	JPanel innerPanel = new JPanel(new BorderLayout());
	// Adds image
	JLabel icon = new JLabel("");
	icon.setIcon(JMTImageLoader.loadImage("Triangle"));
	icon.setHorizontalAlignment(SwingConstants.CENTER);
	icon.setBorder(BorderFactory.createEmptyBorder(BORDERSIZE, BORDERSIZE, BORDERSIZE, BORDERSIZE));
	innerPanel.add(icon, BorderLayout.NORTH);
	// Adds Text Area
	JTextArea text = new JTextArea();
	text.setOpaque(false);
	text.setEditable(false);
	text.setWrapStyleWord(true);
	text.setLineWrap(true);
	text.setText(msg);
	text.setBorder(BorderFactory.createEmptyBorder(BORDERSIZE, BORDERSIZE, BORDERSIZE, BORDERSIZE));
	text.setBackground(icon.getBackground());
	JScrollPane textPane = new JScrollPane(text);
	textPane.setBorder(new EmptyBorder(0, 0, 0, 0));
	innerPanel.add(textPane, BorderLayout.CENTER);
	innerPanel.setBorder(BorderFactory.createEtchedBorder());
	innerPanel.setPreferredSize(warningBoxSize);
	warning.add(innerPanel);
	return warning;
}
 
Example 9
Project: Tarski   File: mxCellEditor.java   Source Code and License Vote up 5 votes
/**
 * 
 */
public mxCellEditor(mxGraphComponent graphComponent) {
  this.graphComponent = graphComponent;

  // Creates the plain text editor
  textArea = new JTextArea();
  textArea.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
  textArea.setOpaque(false);

  // Creates the HTML editor
  editorPane = new JEditorPane();
  editorPane.setOpaque(false);
  editorPane.setBackground(new Color(0, 0, 0, 0));
  editorPane.setContentType("text/html");

  // Workaround for inserted linefeeds in HTML markup with
  // lines that are longar than 80 chars
  editorPane.setEditorKit(new NoLinefeedHtmlEditorKit());

  // Creates the scollpane that contains the editor
  // FIXME: Cursor not visible when scrolling
  scrollPane = new JScrollPane();
  scrollPane.setBorder(BorderFactory.createEmptyBorder());
  scrollPane.getViewport().setOpaque(false);
  scrollPane.setVisible(false);
  scrollPane.setOpaque(false);

  // Installs custom actions
  editorPane.getActionMap().put(CANCEL_EDITING, cancelEditingAction);
  textArea.getActionMap().put(CANCEL_EDITING, cancelEditingAction);
  editorPane.getActionMap().put(SUBMIT_TEXT, textSubmitAction);
  textArea.getActionMap().put(SUBMIT_TEXT, textSubmitAction);

  // Remembers the action map key for the enter keystroke
  editorEnterActionMapKey = editorPane.getInputMap().get(enterKeystroke);
  textEnterActionMapKey = editorPane.getInputMap().get(enterKeystroke);
}
 
Example 10
Project: freecol   File: Utility.java   Source Code and License Vote up 5 votes
/**
 * Creates a text area with standard settings suitable for use in FreeCol
 * panels, without setting its size.
 *
 * @param text The text to display in the text area.
 * @return A suitable text area.
 */
public static JTextArea createTextArea(String text) {
    JTextArea textArea = new JTextArea(text);
    textArea.setOpaque(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    textArea.setFocusable(false);
    return textArea;
}
 
Example 11
Project: GIFKR   File: Interpolator.java   Source Code and License Vote up 5 votes
private void initializeComponents() {

		instructionArea = new JTextArea(getInstructions());
		instructionArea.setLineWrap(true);
		instructionArea.setWrapStyleWord(true);
		instructionArea.setEditable(false);
		instructionArea.setOpaque(false);
		
		animationButton = new JButton() {
			private static final long serialVersionUID = 225462629234945413L;
			@Override 
			public void paint(Graphics ga) {
				Graphics2D g = (Graphics2D) ga;

				g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
				g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

				super.paint(ga);


				double xs = .9, ys = .75;

				g.translate(animationButton.getWidth()*((1-xs)/2), animationButton.getHeight()*((1-ys)/2));
				g.scale(xs, ys);
				paintButton(g, animationButton.getWidth(), animationButton.getHeight());

			}		
			@Override
			public Dimension getPreferredSize() {
				return new Dimension(super.getPreferredSize().width, 50);
			}
		};
	}
 
Example 12
Project: incubator-netbeans   File: ModuleInstallerSupport.java   Source Code and License Vote up 4 votes
private static JPanel problemPanel(String header, String message) {
    JPanel panel = new JPanel();
    JLabel jLabel1 = new javax.swing.JLabel();
    JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
    JTextArea jTextArea1 = new javax.swing.JTextArea();

    jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD));
    jLabel1.setText(header);

    jTextArea1.setColumns(20);
    jTextArea1.setEditable(false);
    jTextArea1.setLineWrap(true);
    jTextArea1.setWrapStyleWord(true);
    jTextArea1.setRows(5);
    jTextArea1.setText(message);
    jTextArea1.setOpaque(false);
    jScrollPane1.setViewportView(jTextArea1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(panel);
    panel.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jLabel1)
                    .addGap(107, 107, 107)))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jLabel1)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE)
            .addGap(82, 82, 82))
    );
    return panel;
}
 
Example 13
Project: jmt   File: FiringSectionPanel.java   Source Code and License Vote up 4 votes
private void initComponents() {
	setLayout(new BorderLayout());

	String modeName = stationData.getTransitionModeName(stationKey, 0);
	firingBorder = new TitledBorder(new EtchedBorder(), "Firing Outcome for " + modeName);
	firingTable = new FiringOutcomeTable();
	firingPane = new JScrollPane(firingTable);
	firingPane.setBorder(firingBorder);
	firingPane.setMinimumSize(new Dimension(300, 240));

	leftPanel = new WarningScrollTable(firingPane, WARNING_CLASS_OUTGOING_ROUTING);
	leftPanel.addCheckVector(stationOutKeys);
	leftPanel.addCheckVector(classKeys);

	addModeButton = new JButton("Add Mode");
	addModeButton.setMinimumSize(DIM_BUTTON_M);
	modeTable = new ModeTable();
	JPanel modePanel = new JPanel(new BorderLayout(5, 5));
	modePanel.setBorder(new TitledBorder(new EtchedBorder(), "Modes"));
	modePanel.setMinimumSize(new Dimension(200, 120));
	modePanel.add(addModeButton, BorderLayout.NORTH);
	modePanel.add(new JScrollPane(modeTable), BorderLayout.CENTER);

	noticeText = new JTextArea("");
	noticeText.setOpaque(false);
	noticeText.setEditable(false);
	noticeText.setLineWrap(true);
	noticeText.setWrapStyleWord(true);
	JScrollPane noticePane = new JScrollPane(noticeText);
	noticePane.setBorder(new TitledBorder(new EtchedBorder(), "Notice"));
	noticePane.setMinimumSize(new Dimension(200, 120));

	JSplitPane rightPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
	rightPanel.setBorder(new EmptyBorder(0, 0, 0, 0));
	rightPanel.setDividerSize(4);
	rightPanel.setResizeWeight(1.0);
	rightPanel.setLeftComponent(modePanel);
	rightPanel.setRightComponent(noticePane);

	JSplitPane mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
	mainPanel.setDividerSize(4);
	mainPanel.setResizeWeight(1.0);
	mainPanel.setLeftComponent(leftPanel);
	mainPanel.setRightComponent(rightPanel);

	add(mainPanel);
}
 
Example 14
Project: jmt   File: EnablingSectionPanel.java   Source Code and License Vote up 4 votes
private void initComponents() {
	setLayout(new BorderLayout());

	String modeName = stationData.getTransitionModeName(stationKey, 0);
	enablingBorder = new TitledBorder(new EtchedBorder(), "Enabling Condition for " + modeName);
	enablingTable = new ConditionTable(true);
	enablingPane = new JScrollPane(enablingTable);
	enablingPane.setBorder(enablingBorder);
	enablingPane.setMinimumSize(new Dimension(300, 120));

	inhibitingBorder = new TitledBorder(new EtchedBorder(), "Inhibiting Condition for " + modeName);
	inhibitingTable = new ConditionTable(false);
	inhibitingPane = new JScrollPane(inhibitingTable);
	inhibitingPane.setBorder(inhibitingBorder);
	inhibitingPane.setMinimumSize(new Dimension(300, 120));

	JPanel conditionPanel = new JPanel(new GridLayout(2, 1, 3, 3));
	conditionPanel.add(enablingPane);
	conditionPanel.add(inhibitingPane);

	leftPanel = new WarningScrollTable(conditionPanel, WARNING_CLASS_INCOMING_ROUTING);
	leftPanel.addCheckVector(stationInKeys);
	leftPanel.addCheckVector(classKeys);

	addModeButton = new JButton("Add Mode");
	addModeButton.setMinimumSize(DIM_BUTTON_M);
	modeTable = new ModeTable();
	JPanel modePanel = new JPanel(new BorderLayout(5, 5));
	modePanel.setBorder(new TitledBorder(new EtchedBorder(), "Modes"));
	modePanel.setMinimumSize(new Dimension(200, 120));
	modePanel.add(addModeButton, BorderLayout.NORTH);
	modePanel.add(new JScrollPane(modeTable), BorderLayout.CENTER);

	noticeText = new JTextArea("");
	noticeText.setOpaque(false);
	noticeText.setEditable(false);
	noticeText.setLineWrap(true);
	noticeText.setWrapStyleWord(true);
	JScrollPane noticePane = new JScrollPane(noticeText);
	noticePane.setBorder(new TitledBorder(new EtchedBorder(), "Notice"));
	noticePane.setMinimumSize(new Dimension(200, 120));

	JSplitPane rightPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
	rightPanel.setBorder(new EmptyBorder(0, 0, 0, 0));
	rightPanel.setDividerSize(4);
	rightPanel.setResizeWeight(1.0);
	rightPanel.setLeftComponent(modePanel);
	rightPanel.setRightComponent(noticePane);

	JSplitPane mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
	mainPanel.setDividerSize(4);
	mainPanel.setResizeWeight(1.0);
	mainPanel.setLeftComponent(leftPanel);
	mainPanel.setRightComponent(rightPanel);

	add(mainPanel);
}
 
Example 15
Project: jmt   File: InGateWaySectionPanel.java   Source Code and License Vote up 4 votes
protected void initComponents() {
	this.setLayout(new BorderLayout());

	gPaneAdvanced = new JRootPane();
	gPaneStandard = new JRootPane();
	forkStrategiesPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	forkStrategiesPane.setDividerSize(4);
	forkStrategiesPane.setBorder(new EmptyBorder(0, 0, 0, 0));
	forkStrategiesPane.setResizeWeight(1.0);

	JSplitPane leftPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
	leftPane.setDividerSize(3);
	leftPane.setBorder(new EmptyBorder(0, 0, 0, 0));
	leftPane.setResizeWeight(0.65);

	WarningScrollTable jsp = new WarningScrollTable(forkStrategies, WARNING_CLASS);
	jsp.setBorder(new TitledBorder(new EtchedBorder(), "Advanced Fork Strategies"));
	jsp.setMinimumSize(new Dimension(200, 100));

	descrTextPane = new JTextArea("");
	descrTextPane.setOpaque(false);
	descrTextPane.setEditable(false);
	descrTextPane.setLineWrap(true);
	descrTextPane.setWrapStyleWord(true);
	descrPane.setBorder(new TitledBorder(new EtchedBorder(), "Description"));
	descrPane.setViewportView(descrTextPane);

	leftPane.setLeftComponent(jsp);
	leftPane.setRightComponent(descrPane);
	forkStrategiesPane.setLeftComponent(leftPane);
	forkProbEditor.setMinimumSize(new Dimension(225, 100));
	forkStrategiesPane.setRightComponent(forkProbEditor);

	gPaneAdvanced.getContentPane().add(forkStrategiesPane);
	gPaneAdvanced.setGlassPane(new GlassPane());
	gPaneAdvanced.getGlassPane().setVisible(sd.getIsSimplifiedFork(stationKey));

	//layout of fragNum panel
	JPanel fragnum = new JPanel();
	fragnum.setLayout(new BorderLayout());
	fragnum.setBorder(new TitledBorder(new EtchedBorder(), "Standard Fork Strategy"));
	useSim.setText("Enable Advanced Fork Strategies");
	JLabel text = new JLabel("Number of tasks to be generated on each output link for each input job (customer) to the Fork:");
	text.setLabelFor(numForkSpinner);
	JPanel forkDegreePane = new JPanel();
	forkDegreePane.add(text);
	forkDegreePane.add(numForkSpinner);
	fragnum.add(forkDegreePane, BorderLayout.NORTH);

	gPaneStandard.getContentPane().add(fragnum);
	gPaneStandard.setGlassPane(new GlassPane());
	gPaneStandard.getGlassPane().setVisible(!sd.getIsSimplifiedFork(stationKey));

	useSim.setSelected(!sd.getIsSimplifiedFork(stationKey));
	numForkSpinner.setEnabled(sd.getIsSimplifiedFork(stationKey));

	useSim.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent arg0) {
			boolean isSim = !useSim.isSelected();
			sd.setIsSimplifiedFork(stationKey, isSim);
			numForkSpinner.setEnabled(isSim);
			gPaneAdvanced.getGlassPane().setVisible(isSim);
			gPaneStandard.getGlassPane().setVisible(!isSim);
		}
	});

	JPanel mainPanel = new JPanel();
	mainPanel.setLayout(new BorderLayout());
	mainPanel.add(gPaneStandard, BorderLayout.NORTH);
	mainPanel.add(gPaneAdvanced, BorderLayout.CENTER);
	add(useSim, BorderLayout.NORTH);
	add(mainPanel, BorderLayout.CENTER);
}
 
Example 16
Project: JuggleMasterPro   File: ExportJDialog.java   Source Code and License Vote up 4 votes
/**
 * Method description
 * 
 * @see
 * @param bytPiOType
 * @param bolPjMPFile
 */
private void setTextArea(byte bytPiOType, byte bytPfileExtension) {

	final JTextArea objLjTextArea =
									new JTextArea(25, Math.max(	135,
																this.objGcontrolJFrame	.getLanguageString(Language.intS_MESSAGE_SEPARATOR_LINE)
																						.length()));

	switch (bytPiOType) {
		case WriteFileJMenuItem.bytS_PATTERNS_FILE:
		case WriteFileJMenuItem.bytS_SITESWAPS_FILE:
			objLjTextArea.setText(this.objGcontrolJFrame.getPatternsManager()
														.toFileString(	Constants.bytS_UNCLASS_CURRENT,
																		bytPfileExtension,
																		true,
																		bytPiOType == WriteFileJMenuItem.bytS_PATTERNS_FILE,
																		true,
																		this.objGcontrolJFrame.objGobjectsJList.intGfilteredObjectIndexA,
																		this.objGcontrolJFrame.objGshortcutsJComboBox.intGfilteredShortcutIndexA,
																		this.objGcontrolJFrame.getLanguage()));
			break;
		case WriteFileJMenuItem.bytS_STYLES_FILE:
			objLjTextArea.setText(this.objGcontrolJFrame.getPatternsManager().toFileString(	Constants.bytS_UNCLASS_CURRENT,
																							bytPfileExtension,
																							false,
																							true,
																							false,
																							null,
																							null,
																							this.objGcontrolJFrame.getLanguage()));
			break;
		case WriteFileJMenuItem.bytS_NEW_PATTERNS_FILE:
			objLjTextArea.setText(this.objGcontrolJFrame.getLanguageString(bytPfileExtension == Constants.bytS_EXTENSION_JMP
																															? Language.intS_MESSAGE_PATTERNS_JMP_FILE_HEADER
																															: bytPfileExtension == Constants.bytS_EXTENSION_JM
																																												? Language.intS_MESSAGE_PATTERNS_JM_FILE_HEADER
																																												: bytPfileExtension == Constants.bytS_EXTENSION_JAP
																																																									? Language.intS_MESSAGE_PATTERNS_JAP_FILE_HEADER
																																																									: Constants.bytS_UNCLASS_NO_VALUE));
			break;
		case WriteFileJMenuItem.bytS_NEW_LANGUAGE_FILE:
		case WriteFileJMenuItem.bytS_NEW_EMPTY_LANGUAGE_FILE:
		case WriteFileJMenuItem.bytS_NEW_DEFAULT_LANGUAGE_FILE:
			objLjTextArea.setText(Language.getNewLanguageString(bytPiOType == WriteFileJMenuItem.bytS_NEW_DEFAULT_LANGUAGE_FILE));
			break;
		case WriteFileJMenuItem.bytS_CURRENT_LANGUAGE_FILE:
			objLjTextArea.setText(this.objGcontrolJFrame.getLanguage().getLanguageString());
			break;
	}

	objLjTextArea.setFont(new Font("Courier", Font.PLAIN, 11));
	objLjTextArea.setCaretPosition(0);
	objLjTextArea.setLineWrap(false);
	objLjTextArea.setOpaque(true);
	objLjTextArea.setEditable(false);

	final JScrollPane objLscrollPane =
										new JScrollPane(objLjTextArea,
														ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
														ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	objLscrollPane.setOpaque(true);
	objLscrollPane.setBorder(Constants.objS_GRAPHICS_JUGGLE_BORDER);
	this.add(objLscrollPane);
	this.validate();
	this.pack();
}
 
Example 17
Project: jmt   File: PopulationMixPanel.java   Source Code and License Vote up 4 votes
public void initialize() {
	JPanel edit = new JPanel(new GridLayout(4, 1, 0, 5));
	fromLabel = new JLabel("Initial ß: ");
	from = new JSpinner(new SpinnerNumberModel(PMPA.getInitialValue(), 0.000, 1.000, 0.001));
	from.setToolTipText("Sets the initial proportion of jobs");
	toLabel = new JLabel("Final ß: ");
	to = new JSpinner(new SpinnerNumberModel(PMPA.getFinalValue(), 0.000, 1.000, 0.001));
	to.setToolTipText("Sets the final proportion of jobs");
	stepsLabel = new JLabel("Steps (n. of exec.): ");
	int maxSteps = PMPA.searchForAvailableSteps();
	if (maxSteps > ParametricAnalysis.MAX_STEP_NUMBER) {
		maxSteps = ParametricAnalysis.MAX_STEP_NUMBER;
	}
	steps = new JSpinner(new SpinnerNumberModel(PMPA.getNumberOfSteps(), 2, maxSteps, 1));
	steps.setToolTipText("Sets the number of steps to be performed");
	Vector<Object> classes = cd.getClosedClassKeys();
	String[] classNames = new String[classes.size()];
	for (int i = 0; i < classes.size(); i++) {
		classNames[i] = cd.getClassName(classes.get(i));
	}
	classChooserLabel = new JLabel("Class: ");
	classChooser = new JComboBox(classNames);
	classChooser.setToolTipText("Sets the class the inserted values will refer to");
	classChooser.setSelectedItem(cd.getClassName(PMPA.getReferenceClass()));
	edit.add(fromLabel);
	edit.add(from);
	edit.add(toLabel);
	edit.add(to);
	edit.add(stepsLabel);
	edit.add(steps);
	edit.add(classChooserLabel);
	edit.add(classChooser);
	edit.setPreferredSize(new Dimension(130, 88));
	JPanel editLables = new JPanel(new GridLayout(4, 1, 0, 5));
	editLables.add(fromLabel);
	editLables.add(toLabel);
	editLables.add(stepsLabel);
	editLables.add(classChooserLabel);
	editLables.setPreferredSize(new Dimension(100, 88));
	JPanel editPanel = new JPanel();
	editPanel.add(editLables);
	editPanel.add(edit);
	editPanel.setBorder(new EmptyBorder(15, 20, 0, 20));
	JPanel cont = new JPanel(new BorderLayout());
	cont.add(editPanel, BorderLayout.CENTER);
	scroll = new JScrollPane(cont);
	title = new TitledBorder("Type of population mix");
	scroll.setBorder(title);
	description = new JTextArea(DESCRIPTION);
	description.setOpaque(false);
	description.setEditable(false);
	description.setLineWrap(true);
	description.setWrapStyleWord(true);
	descrPane = new JScrollPane(description);
	descriptionTitle = new TitledBorder(new EtchedBorder(), "Description");
	descrPane.setBorder(descriptionTitle);
	descrPane.setMinimumSize(new Dimension(80, 0));
	scroll.setMinimumSize(new Dimension(360, 0));
	setLeftComponent(scroll);
	setRightComponent(descrPane);
	setListeners();
	this.setBorder(new EmptyBorder(5, 0, 5, 0));
}
 
Example 18
Project: QN-ACTR-Release   File: PopulationMixPanel.java   Source Code and License Vote up 4 votes
public void initialize() {
	JPanel edit = new JPanel(new GridLayout(4, 1, 0, 5));
	fromLabel = new JLabel("Initial �: ");
	from = new JSpinner(new SpinnerNumberModel(PMPA.getInitialValue(), 0.000, 1.000, 0.001));
	from.setToolTipText("Sets the initial proportion of jobs");
	toLabel = new JLabel("Final �: ");
	to = new JSpinner(new SpinnerNumberModel(PMPA.getFinalValue(), 0.000, 1.000, 0.001));
	to.setToolTipText("Sets the final proportion of jobs");
	stepsLabel = new JLabel("Steps (n. of exec.): ");
	int maxSteps = PMPA.searchForAvaibleSteps();
	if (maxSteps > ParametricAnalysis.MAX_STEP_NUMBER) {
		maxSteps = ParametricAnalysis.MAX_STEP_NUMBER;
	}
	steps = new JSpinner(new SpinnerNumberModel(PMPA.getNumberOfSteps(), 2, maxSteps, 1));
	steps.setToolTipText("Sets the number of steps to be performed");
	Vector classes = cd.getClosedClassKeys();
	String[] classNames = new String[classes.size()];
	for (int i = 0; i < classes.size(); i++) {
		classNames[i] = cd.getClassName(classes.get(i));
	}
	classChooserLabel = new JLabel("Class: ");
	classChooser = new JComboBox(classNames);
	classChooser.setToolTipText("Sets the class the inserted values will refer to");
	classChooser.setSelectedItem(cd.getClassName(PMPA.getReferenceClass()));
	edit.add(fromLabel);
	edit.add(from);
	edit.add(toLabel);
	edit.add(to);
	edit.add(stepsLabel);
	edit.add(steps);
	edit.add(classChooserLabel);
	edit.add(classChooser);
	edit.setPreferredSize(new Dimension(130, 88));
	JPanel editLables = new JPanel(new GridLayout(4, 1, 0, 5));
	editLables.add(fromLabel);
	editLables.add(toLabel);
	editLables.add(stepsLabel);
	editLables.add(classChooserLabel);
	editLables.setPreferredSize(new Dimension(100, 88));
	JPanel editPanel = new JPanel();
	editPanel.add(editLables);
	editPanel.add(edit);
	editPanel.setBorder(new EmptyBorder(15, 20, 0, 20));
	JPanel cont = new JPanel(new BorderLayout());
	cont.add(editPanel, BorderLayout.CENTER);
	scroll = new JScrollPane(cont);
	title = new TitledBorder("Type of population mix");
	scroll.setBorder(title);
	description = new JTextArea(DESCRIPTION);
	description.setOpaque(false);
	description.setEditable(false);
	description.setLineWrap(true);
	description.setWrapStyleWord(true);
	descrPane = new JScrollPane(description);
	descriptionTitle = new TitledBorder(new EtchedBorder(), "Description");
	descrPane.setBorder(descriptionTitle);
	descrPane.setMinimumSize(new Dimension(80, 0));
	scroll.setMinimumSize(new Dimension(360, 0));
	setLeftComponent(scroll);
	setRightComponent(descrPane);
	setListeners();
	this.setBorder(new EmptyBorder(5, 0, 5, 0));
}
 
Example 19
Project: QN-ACTR-Release   File: AlphaNumStartScreen.java   Source Code and License Vote up 4 votes
private void formatJTextArea(JTextArea jta) {
	jta.setOpaque(false);
	jta.setEditable(false);
}
 
Example 20
Project: QN-ACTR-Release   File: UniqueStartScreen.java   Source Code and License Vote up 4 votes
private void formatJTextArea(JTextArea jta) {
	jta.setOpaque(false);
	jta.setEditable(false);
}