m_totalTf.setEditable(false); JPanel content = new JPanel(); content.setLayout(new FlowLayout()); content.add(new JLabel("Input")); content.add(m_userInputTf); content.add(m_multiplyBtn); content.add(new JLabel("Total")); content.add(m_totalTf); this.pack(); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
/** * Creates a new <code>DetailPanel</code> instance. * * @param aTable the table to listen for selections on * @param aModel the model backing the table */ DetailPanel(JTable aTable, final MyTableModel aModel) { mModel = aModel; setLayout(new BorderLayout()); setBorder(BorderFactory.createTitledBorder("Details: ")); mDetails = new JEditorPane(); mDetails.setEditable(false); mDetails.setContentType("text/html"); add(new JScrollPane(mDetails), BorderLayout.CENTER); final ListSelectionModel rowSM = aTable.getSelectionModel(); rowSM.addListSelectionListener(this); }
int height = 100; gui = new JPanel(new BorderLayout(3,4)); gui.add(quality, BorderLayout.WEST); JPanel controls = new JPanel(new GridLayout(0,1,0,0)); antialiasing = new JCheckBox("Anti-aliasing", false); rendering = new JCheckBox("Rendering - Quality", true); dithering = new JCheckBox("Dithering", false); controls.add(antialiasing); controls.add(fractionalMetrics); JPanel lcdContrastPanel = new JPanel(new FlowLayout(FlowLayout.LEADING)); lcdContrastPanel.add(textLcdContrast); lcdContrastPanel.add(new JLabel("Text LCD Contrast")); gui.add(images, BorderLayout.CENTER); output = new JTextArea(4,40); output.setEditable(false); gui.add(new JScrollPane(output), BorderLayout.SOUTH);
import java.io.IOException; import javax.swing.*; public class ExempleText { public static void main(String[] args) { String url = "C:/Users/Nimit/Desktop/n.txt"; try { JFrame frame=new JFrame("Hi"); JEditorPane Pane = new JEditorPane(url); Pane.setEditable(false); frame.add(new JScrollPane(Pane)); } catch(IOException ioe) { System.err.println("Error displaying " + url); ioe.printStackTrace(); } } }
e.setVisible(true); web.setEditable(false); getContentPane().add(scrollPane); this.setBounds( 0, 0, 200, 200);
ta.setFont(font); ta.setText(fontText); ta.setEditable(false); JEditorPane op = new JEditorPane(); op.setContentType("text/html"); op.setEditable(false); JPanel fontTable = new JPanel(new BorderLayout(3, 1)); JPanel fontNameCol = new JPanel(new GridLayout(0, 1, 2, 2)); JPanel fontExampleCol = new JPanel(new GridLayout(0, 1, 2, 2)); fontTable.add(fontNameCol, BorderLayout.WEST); fontTable.add(fontExampleCol, BorderLayout.CENTER); for (int ii = 0; ii < fonts.length; ii++) { fontNameCol.add(new JLabel(fonts[ii])); fontExampleCol.add(getExampleOfFont(fonts[ii])); p.add(tabPane, BorderLayout.CENTER); p.setPreferredSize(new Dimension(400, 400)); JFrame f = new JFrame("Properties"); f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); f.getContentPane().add(p, BorderLayout.CENTER); f.pack(); f.setMinimumSize(f.getPreferredSize()); f.setSize(600, 500); f.setLocationRelativeTo(null); f.setVisible(true);
setEditable(false); setForeground(standardColor); setBorder(standardBorder); JPanel p = new JPanel(new GridLayout(0,1)); File f = new File(".","LinkLabel.java"); p.add(linkLabelFile); p.add(linkLabelWeb); JPanel labelConstrain = new JPanel(new BorderLayout()); labelConstrain.add( linkLabelConstrain, BorderLayout.EAST ); p.add(labelConstrain);
public ScrollingTextPane(boolean editable) { textPane_ = new JTextPane(); textPane_.setEditable(editable); setLayout(new BorderLayout()); add("Center", new JScrollPane(textPane_)); }
import java.io.*; import java.net.*; import java.util.regex.*; import javax.swing.*; public class webloader { static JComponent page; public static void loadcode(){ JEditorPane jep = new JEditorPane(); jep.setEditable(false); try { jep.setPage("http://(server):(port)/" + web.url); } catch (IOException e) { jep.setContentType("text/html"); jep.setText("<html>Could not load webpage</html>"); } JScrollPane scrollPane = new JScrollPane(jep); JFrame f = new JFrame(web.url); f.getContentPane().add(scrollPane); f.setSize(512, 342); f.show(); } }
JFrame frame = new JFrame("WindowCommunication"); frame.getContentPane().add(new MyFramePanel()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); field.setEditable(false); field.setFocusable(false); add(field); add(openDialogeBtn); ModalityType.APPLICATION_MODAL); dialog.getContentPane().add(dialogPanel); dialog.pack(); dialog.setLocationRelativeTo(null);
JPanel statusBar = new JPanel(); pageInfo_.setEditable(false); pageInfo_.transferFocus(); zoomInfo_.setEditable(false); zoomInfo_.transferFocus(); statusBar.add(pageInfo_); statusBar.add(zoomInfo_);
import javax.swing.*; import java.awt.*; public class PreviewClass extends JPanel{ private JTextField namePreview; /** * @param namePreview the namePreview to set */ public void setNamePreview(String textContent) { this.namePreview.setText(textContent); } public PreviewClass() { setLayout(new FlowLayout()); namePreview=new JTextField(15); namePreview.setEditable(false); add(namePreview); } }
jep.setText("Welcome to <a href='http://stackoverflow.com/'>StackOverflow</a>."); jep.setEditable(false);//so its not editable jep.setOpaque(false);//so we dont see whit background JFrame f = new JFrame("HyperlinkListener"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(jep); f.pack(); f.setVisible(true);
textArea.setWrapStyleWord(true); textArea.setLineWrap(true); textArea.setEditable(false); textArea.setFocusable(false); JPanel panel = new JPanel(new BorderLayout(3,3)); panel.add(button, BorderLayout.NORTH); panel.add(new JScrollPane(textArea), BorderLayout.CENTER);
/** * Creates a new <code>DetailPanel</code> instance. * * @param aTable the table to listen for selections on * @param aModel the model backing the table */ DetailPanel(JTable aTable, final MyTableModel aModel) { mModel = aModel; setLayout(new BorderLayout()); setBorder(BorderFactory.createTitledBorder("Details: ")); mDetails = new JEditorPane(); mDetails.setEditable(false); mDetails.setContentType("text/html"); add(new JScrollPane(mDetails), BorderLayout.CENTER); final ListSelectionModel rowSM = aTable.getSelectionModel(); rowSM.addListSelectionListener(this); }
this.setBackground(new Color(0, 0, 0, alpha)); this.setFont(new Font("Serif", Font.ITALIC, 24)); this.setEditable(false); this.setText("Twas brillig and the slithy toves,\n" + "Did gyre and gimble in the wabe;\n" JFrame f = new JFrame(); f.setLayout(new FlowLayout()); f.getContentPane().setBackground(new Color(0xffffc0)); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(); panel.setBackground(new Color(0xffffc0)); panel.add(new TransparentTextArea(0)); jif.add(panel); jif.setVisible(true); f.add(jif); f.pack(); f.setVisible(true);
/** * Creates a new <code>DetailPanel</code> instance. * * @param aTable the table to listen for selections on * @param aModel the model backing the table */ DetailPanel(JTable aTable, final MyTableModel aModel) { mModel = aModel; setLayout(new BorderLayout()); setBorder(BorderFactory.createTitledBorder("Details: ")); mDetails = new JEditorPane(); mDetails.setEditable(false); mDetails.setContentType("text/html"); add(new JScrollPane(mDetails), BorderLayout.CENTER); final ListSelectionModel rowSM = aTable.getSelectionModel(); rowSM.addListSelectionListener(this); }
display.setEditable( false ); display.setHorizontalAlignment(JTextField.RIGHT); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout( new GridLayout(0, 5) ); buttons = new JButton[10]; button.setMnemonic( text.charAt(0) ); buttons[i] = button; buttonPanel.add( button ); getContentPane().add(display, BorderLayout.NORTH); getContentPane().add(buttonPanel, BorderLayout.SOUTH); setResizable( false ); frame.setDefaultCloseOperation( EXIT_ON_CLOSE ); frame.pack(); frame.setLocationRelativeTo( null ); frame.setVisible(true);
/** * Creates a new <code>DetailPanel</code> instance. * * @param aTable the table to listen for selections on * @param aModel the model backing the table */ DetailPanel(JTable aTable, final MyTableModel aModel) { mModel = aModel; setLayout(new BorderLayout()); setBorder(BorderFactory.createTitledBorder("Details: ")); mDetails = new JEditorPane(); mDetails.setEditable(false); mDetails.setContentType("text/html"); add(new JScrollPane(mDetails), BorderLayout.CENTER); final ListSelectionModel rowSM = aTable.getSelectionModel(); rowSM.addListSelectionListener(this); }
textField.setEditable(false); JPanel panel = new JPanel(); panel.add(textField); panel.add(showDialogBtn); add(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); JPanel panel = new JPanel(); panel.add(textfield); panel.add(confirmBtn); add(panel); pack(); setLocationRelativeTo(frame);