本文整理汇总了Java中javax.swing.JTextArea.setOpaque方法的典型用法代码示例。如果您正苦于以下问题:Java JTextArea.setOpaque方法的具体用法?Java JTextArea.setOpaque怎么用?Java JTextArea.setOpaque使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTextArea
的用法示例。
在下文中一共展示了JTextArea.setOpaque方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createOthersPanel
import javax.swing.JTextArea; //导入方法依赖的package包/类
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);
}
示例2: buildMessageLabel
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* 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;
}
示例3: getTitleComponent
import javax.swing.JTextArea; //导入方法依赖的package包/类
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;
}
示例4: createMessageComponent
import javax.swing.JTextArea; //导入方法依赖的package包/类
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;
}
示例5: warningPanel
import javax.swing.JTextArea; //导入方法依赖的package包/类
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;
}
示例6: createMultilineLabel
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* 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;
}
示例7: createTextArea
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* 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;
}
示例8: createWarningPanel
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* 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;
}
示例9: mxCellEditor
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
*
*/
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);
}
示例10: initializeComponents
import javax.swing.JTextArea; //导入方法依赖的package包/类
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);
}
};
}
示例11: problemPanel
import javax.swing.JTextArea; //导入方法依赖的package包/类
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;
}
示例12: initComponents
import javax.swing.JTextArea; //导入方法依赖的package包/类
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);
}
示例13: initComponents
import javax.swing.JTextArea; //导入方法依赖的package包/类
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);
}
示例14: initComponents
import javax.swing.JTextArea; //导入方法依赖的package包/类
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);
}
示例15: setTextArea
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* 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();
}