List of usage examples for java.awt Font Font
private Font(String name, int style, float sizePts)
From source file:ExposedInt.java
public void init() { Panel buttonPanel = new PanelWithInsets(0, 0, 0, 0); buttonPanel.setLayout(new GridLayout(3, 2, 5, 5)); buttonPanel.add(new GrayButton(ExposedIntStringTable.increment)); buttonPanel.add(new GrayButton(ExposedIntStringTable.decrement)); buttonPanel.add(minimumButton);/*from w w w . ja v a 2s. c om*/ buttonPanel.add(maximumButton); buttonPanel.add(zeroButton); buttonPanel.add(new GrayButton(ExposedIntStringTable.negate)); zeroButton.disable(); binaryField = new Label("00000000000000000000000000000000"); hexField = new Label("00000000"); decimalField = new Label("0"); Font fieldFont = new Font("TimesRoman", Font.PLAIN, 12); binaryField.setFont(fieldFont); hexField.setFont(fieldFont); decimalField.setFont(fieldFont); Panel numberPanel = new Panel(); numberPanel.setBackground(Color.white); numberPanel.setLayout(new GridLayout(3, 1)); Panel binaryPanel = new Panel(); binaryPanel.setLayout(new BorderLayout()); binaryPanel.add("Center", binaryField); numberPanel.add(binaryPanel); Panel hexPanel = new Panel(); hexPanel.setLayout(new BorderLayout()); hexPanel.add("Center", hexField); numberPanel.add(hexPanel); numberPanel.add(decimalField); Panel labelPanel = new Panel(); labelPanel.setBackground(Color.white); labelPanel.setLayout(new GridLayout(3, 1)); Label label = new Label(ExposedIntStringTable.binary, Label.CENTER); Font labelFont = new Font("Helvetica", Font.ITALIC, 11); label.setFont(labelFont); labelPanel.add(label); label = new Label(ExposedIntStringTable.hex, Label.CENTER); label.setFont(labelFont); labelPanel.add(label); label = new Label(ExposedIntStringTable.decimal, Label.CENTER); label.setFont(labelFont); labelPanel.add(label); Panel dataPanel = new Panel(); dataPanel.setLayout(new BorderLayout()); dataPanel.add("West", labelPanel); dataPanel.add("Center", numberPanel); ColoredLabel title = new ColoredLabel(ExposedIntStringTable.title, Label.CENTER, Color.yellow); title.setFont(new Font("Helvetica", Font.BOLD, 12)); setBackground(Color.red); setLayout(new BorderLayout(5, 5)); add("North", title); add("West", buttonPanel); add("Center", dataPanel); }
From source file:unalcol.termites.boxplots.HybridRoundNumberReport.java
/** * Creates a new demo./*from w ww .j a va 2 s . co m*/ * * @param title the frame title. * @param pf */ public HybridRoundNumberReport(final String title, ArrayList<Double> pf) { super(title); final BoxAndWhiskerCategoryDataset dataset = createSampleDataset(pf); final CategoryAxis xAxis = new CategoryAxis(""); //final NumberAxis yAxis = new NumberAxis("Round number"); final NumberAxis yAxis = new NumberAxis(""); yAxis.setAutoRangeIncludesZero(false); final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(); renderer.setFillBox(false); renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator()); final CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer); Font font = new Font("Dialog", Font.PLAIN, 14); xAxis.setTickLabelFont(font); yAxis.setTickLabelFont(font); yAxis.setLabelFont(font); final JFreeChart chart = new JFreeChart("Round Number" + getTitle(pf), new Font("SansSerif", Font.BOLD, 18), plot, true); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(650, 370)); setContentPane(chartPanel); TextTitle legendText = null; if (pf.size() == 1) { legendText = new TextTitle("Population Size"); } else { legendText = new TextTitle("Population Size - Probability of Failure"); } legendText.setFont(font); legendText.setPosition(RectangleEdge.BOTTOM); chart.addSubtitle(legendText); chart.getLegend().setItemFont(font); FileOutputStream output; try { output = new FileOutputStream("roundnumber1" + pf + ".jpg"); ChartUtilities.writeChartAsJPEG(output, 1.0f, chart, 1350, 400, null); } catch (FileNotFoundException ex) { Logger.getLogger(HybridRoundNumberReport.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(HybridRoundNumberReport.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.aw.swing.mvp.grid.GridManager.java
private void configureGridTitleColor() { JPanel pnlGrid = ipView.getPnlGrid(gridIndex); pnlGrid.setBorder(BorderFactory.createLineBorder(new Color(131, 172, 219))); JPanel pnlTitGrid = ipView.getPnlTitGrid(gridIndex); pnlTitGrid.setBackground(new Color(131, 172, 219)); pnlTitGrid.setLayout(//from w w w . j a v a2 s .c om new FormLayout("fill:16dlu:noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,right:pref:grow", "center:16dlu:noGrow")); JLabel lblTitGrid = ipView.getLblTitGrid(gridIndex); lblTitGrid.setFont(new Font(lblTitGrid.getFont().getName(), Font.BOLD, 14)); lblTitGrid.setForeground(Color.black); numRecords = new JLabel(""); numRecords.setFont(new Font(lblTitGrid.getFont().getName(), Font.BOLD, 14)); numRecords.setForeground(Color.black); numRecords.setVisible(showTotalRegistros); pnlTitGrid.remove(lblTitGrid); CellConstraints cc = new CellConstraints(); pnlTitGrid.add(lblTitGrid, cc.xy(3, 1)); pnlTitGrid.add(numRecords, cc.xy(5, 1)); }
From source file:de.aidger.view.utils.Charts.java
/** * Creates a xy area chart.// ww w .j a v a2 s . c o m * * @param title * the diagram title * @param dataset * the dataset. * @param width * the width of the chart as image * @param height * the height of the chart as image * @return the xy area chart as image */ public static ImageIcon createXYAreaChart(String title, XYDataset dataset, int width, int height) { JFreeChart chart = ChartFactory.createXYAreaChart(title, "", "", dataset, PlotOrientation.VERTICAL, false, false, false); Font titleFont = UIManager.getFont("TitledBorder.font"); chart.setBackgroundPaint(null); chart.getTitle().setFont(new Font(titleFont.getName(), titleFont.getStyle(), 14)); chart.getTitle().setPaint(UIManager.getColor("TitledBorder.titleColor")); chart.setBorderPaint(null); XYPlot plot = chart.getXYPlot(); plot.setInsets(new RectangleInsets(10, 1, 5, 1)); plot.setBackgroundPaint(null); plot.setOutlineVisible(false); plot.setNoDataMessage(_("No data to display.")); ValueAxis domainAxis = new DateAxis(); domainAxis.setLowerMargin(0.0); domainAxis.setUpperMargin(0.0); domainAxis.setTickLabelFont(UIManager.getFont("RootPane.font")); ValueAxis rangeAxis = new NumberAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); plot.setDomainAxis(domainAxis); plot.setRangeAxis(rangeAxis); plot.setForegroundAlpha(0.5f); return new ImageIcon(chart.createBufferedImage(width, height)); }
From source file:br.ufrgs.enq.jcosmo.ui.SigmaProfileAreaPanel.java
public SigmaProfileAreaPanel() { setLayout(new BorderLayout()); sigmaProfileChart = ChartFactory.createStackedXYAreaChart(null, "sigma [e/]", "p(sigma)area []", dataset, PlotOrientation.VERTICAL, true, true, false); sigmaProfilePlot = sigmaProfileChart.getXYPlot(); sigmaProfilePlot.getDomainAxis().setAutoRange(false); sigmaProfilePlot.getDomainAxis().setRange(new Range(-0.025, 0.025)); sigmaProfilePlot.setBackgroundPaint(Color.WHITE); sigmaProfilePlot.setAxisOffset(new RectangleInsets(8, 0, 0, 16)); sigmaProfilePlot.setDomainGridlinesVisible(false); sigmaProfilePlot.setRangeGridlinesVisible(false); Font font = new Font("DeJaVu Serif", Font.BOLD, 16); Font fontMini = new Font("DeJaVu Serif", 0, 12); sigmaProfileChart.getLegend().setItemFont(fontMini); sigmaProfilePlot.getDomainAxis().setLabelFont(font); sigmaProfilePlot.getRangeAxis().setLabelFont(font); sigmaProfilePlot.getDomainAxis().setTickLabelFont(fontMini); sigmaProfilePlot.getRangeAxis().setTickLabelFont(fontMini); sigmaProfilePlot.getDomainAxis().setAxisLinePaint(Color.BLACK); sigmaProfilePlot.getDomainAxis().setTickMarkPaint(Color.BLACK); sigmaProfilePlot.getDomainAxis().setTickMarkInsideLength(4); sigmaProfilePlot.getDomainAxis().setTickMarkOutsideLength(0); sigmaProfilePlot.getRangeAxis().setAxisLinePaint(Color.BLACK); sigmaProfilePlot.getRangeAxis().setTickMarkPaint(Color.BLACK); sigmaProfilePlot.getRangeAxis().setTickMarkInsideLength(4); sigmaProfilePlot.getRangeAxis().setTickMarkOutsideLength(0); add(new ChartPanel(sigmaProfileChart), BorderLayout.CENTER); }
From source file:net.sf.mzmine.chartbasics.chartthemes.ChartThemeFactory.java
public static EStandardChartTheme createBlackNWhiteTheme() { EStandardChartTheme theme = new EStandardChartTheme(THEME.BNW_PRINT, "BnW"); // Fonts//w ww. j av a 2s.c om theme.setExtraLargeFont(new Font("Arial", Font.BOLD, 16)); theme.setLargeFont(new Font("Arial", Font.BOLD, 11)); theme.setRegularFont(new Font("Arial", Font.PLAIN, 11)); theme.setSmallFont(new Font("Arial", Font.PLAIN, 11)); // Paints theme.setTitlePaint(Color.black); theme.setSubtitlePaint(Color.black); theme.setLegendItemPaint(Color.black); theme.setPlotOutlinePaint(Color.black); theme.setBaselinePaint(Color.black); theme.setCrosshairPaint(Color.black); theme.setLabelLinkPaint(Color.black); theme.setTickLabelPaint(Color.black); theme.setAxisLabelPaint(Color.black); theme.setShadowPaint(Color.black); theme.setItemLabelPaint(Color.black); theme.setLegendBackgroundPaint(Color.white); theme.setChartBackgroundPaint(Color.white); theme.setPlotBackgroundPaint(Color.white); // paint sequence: add black Paint[] colors = new Paint[] { Color.BLACK, new Color(0xFF, 0x55, 0x55), new Color(0x55, 0x55, 0xFF), new Color(0x55, 0xFF, 0x55), new Color(0xFF, 0xFF, 0x55), new Color(0xFF, 0x55, 0xFF), new Color(0x55, 0xFF, 0xFF), Color.pink, Color.gray, ChartColor.DARK_RED, ChartColor.DARK_BLUE, ChartColor.DARK_GREEN, ChartColor.DARK_YELLOW, ChartColor.DARK_MAGENTA, ChartColor.DARK_CYAN, Color.darkGray, ChartColor.LIGHT_RED, ChartColor.LIGHT_BLUE, ChartColor.LIGHT_GREEN, ChartColor.LIGHT_YELLOW, ChartColor.LIGHT_MAGENTA, ChartColor.LIGHT_CYAN, Color.lightGray, ChartColor.VERY_DARK_RED, ChartColor.VERY_DARK_BLUE, ChartColor.VERY_DARK_GREEN, ChartColor.VERY_DARK_YELLOW, ChartColor.VERY_DARK_MAGENTA, ChartColor.VERY_DARK_CYAN, ChartColor.VERY_LIGHT_RED, ChartColor.VERY_LIGHT_BLUE, ChartColor.VERY_LIGHT_GREEN, ChartColor.VERY_LIGHT_YELLOW, ChartColor.VERY_LIGHT_MAGENTA, ChartColor.VERY_LIGHT_CYAN }; theme.setDrawingSupplier( new DefaultDrawingSupplier(colors, DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE, DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE)); theme.setErrorIndicatorPaint(Color.black); theme.setGridBandPaint(new Color(255, 255, 255, 20)); theme.setGridBandAlternatePaint(new Color(255, 255, 255, 40)); // axis Color transp = new Color(0, 0, 0, 200); theme.setRangeGridlinePaint(transp); theme.setDomainGridlinePaint(transp); theme.setAxisLinePaint(Color.black); // axis offset theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0)); return theme; }
From source file:ca.uhn.hl7v2.testpanel.ui.ActivityDetailsCellRenderer.java
public ActivityDetailsCellRenderer(ActivityTable theTablePanel) { super(theTablePanel); myFixedWidthFont = new Font("Lucida Console", Font.PLAIN, 12); myVarWidthFont = new Font("Lucida", Font.PLAIN, 12); }
From source file:unalcol.termites.boxplots.ECALinfoCollected.java
/** * Creates a new demo./*from w w w. j a v a2 s . co m*/ * * @param title the frame title. * @param pf */ public ECALinfoCollected(final String title, ArrayList<Double> pf) { super(title); final BoxAndWhiskerCategoryDataset dataset = createSampleDataset(pf); final CategoryAxis xAxis = new CategoryAxis(""); final NumberAxis yAxis = new NumberAxis(""); //final NumberAxis yAxis = new NumberAxis("Information Collected"); yAxis.setAutoRangeIncludesZero(false); final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(); renderer.setFillBox(false); renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator()); final CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer); Font font = new Font("Dialog", Font.PLAIN, 16); xAxis.setTickLabelFont(font); yAxis.setTickLabelFont(font); yAxis.setLabelFont(font); final JFreeChart chart = new JFreeChart("Information Collected " + getTitle(pf), new Font("SansSerif", Font.BOLD, 18), plot, true); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(650, 370)); setContentPane(chartPanel); TextTitle legendText = null; if (pf.size() == 1) { legendText = new TextTitle("Population Size"); } else { legendText = new TextTitle("Population Size - Probability of Failure"); } legendText.setFont(font); legendText.setPosition(RectangleEdge.BOTTOM); chart.addSubtitle(legendText); chart.getLegend().setItemFont(font); FileOutputStream output; try { output = new FileOutputStream("ECALinfoColl" + pf + ".jpg"); ChartUtilities.writeChartAsJPEG(output, 1.0f, chart, 400, 400, null); } catch (FileNotFoundException ex) { Logger.getLogger(ECALinfoCollected.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(ECALinfoCollected.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:autoGui.RegisterPagePanel.java
RegisterPagePanel(JFrame parent, MouseAdapter backHandler) { parent.getContentPane().add(RegisterPage, "name_22846752421143"); RegisterPage.setLayout(null);/*w w w .j a v a 2 s . c o m*/ //System.out.println(parent.getContentPane()); RegisterPage.setBounds(100, 100, 1036, 608); email = new JTextField(); email.setBounds(642, 87, 116, 22); RegisterPage.add(email); email.setColumns(10); JLabel lblEmail = new JLabel("Email*"); lblEmail.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblEmail.setBounds(506, 89, 56, 16); RegisterPage.add(lblEmail); JLabel lblNewLabel = new JLabel("Password*"); lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNewLabel.setBounds(506, 132, 71, 16); RegisterPage.add(lblNewLabel); JLabel lblFirstName = new JLabel("First Name*"); lblFirstName.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblFirstName.setBounds(141, 87, 88, 16); RegisterPage.add(lblFirstName); firstName = new JTextField(); firstName.setBounds(241, 85, 142, 22); RegisterPage.add(firstName); firstName.setColumns(10); JLabel lblNewLabel_1 = new JLabel("Middle Name"); lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNewLabel_1.setBounds(141, 132, 88, 16); RegisterPage.add(lblNewLabel_1); middleName = new JTextField(); middleName.setBounds(241, 129, 142, 22); RegisterPage.add(middleName); middleName.setColumns(10); JLabel lblNewLabel_2 = new JLabel("Last Name*"); lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNewLabel_2.setBounds(141, 174, 88, 16); RegisterPage.add(lblNewLabel_2); lastName = new JTextField(); lastName.setBounds(241, 172, 142, 22); RegisterPage.add(lastName); lastName.setColumns(10); JLabel lblPersonalInformation = new JLabel("Personal Information"); lblPersonalInformation.setFont(new Font("Tahoma", Font.PLAIN, 16)); lblPersonalInformation.setBounds(86, 33, 159, 27); RegisterPage.add(lblPersonalInformation); JLabel lblContactInformation = new JLabel("Contact Information"); lblContactInformation.setFont(new Font("Tahoma", Font.PLAIN, 16)); lblContactInformation.setBounds(459, 33, 175, 27); RegisterPage.add(lblContactInformation); JLabel lblPhoneNumber = new JLabel("Phone*"); lblPhoneNumber.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblPhoneNumber.setBounds(506, 217, 71, 16); RegisterPage.add(lblPhoneNumber); phone = new JTextField(); phone.setBounds(642, 215, 116, 22); RegisterPage.add(phone); phone.setColumns(10); password = new JPasswordField(); password.setBounds(642, 130, 116, 22); RegisterPage.add(password); JButton btnBack_5 = new JButton("Back"); btnBack_5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); btnBack_5.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (lastPage == 6) { lastPage = 4; } RegisterPage.setVisible(false); parent.getContentPane().getComponent(lastPage).setVisible(true); backHandler.mouseClicked(e); } }); btnBack_5.setBounds(12, 525, 97, 25); RegisterPage.add(btnBack_5); JButton btnExit_6 = new JButton("Exit"); btnExit_6.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { parent.setVisible(false); parent.dispose(); } }); btnExit_6.setBounds(909, 525, 97, 25); RegisterPage.add(btnExit_6); JLabel lblAddress = new JLabel("Address*"); lblAddress.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblAddress.setBounds(141, 217, 56, 16); RegisterPage.add(lblAddress); address = new JTextField(); address.setBounds(241, 215, 142, 22); RegisterPage.add(address); address.setColumns(10); address2 = new JTextField(); address2.setBounds(241, 260, 142, 22); RegisterPage.add(address2); address2.setColumns(10); JLabel lblCity = new JLabel("City*"); lblCity.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblCity.setBounds(141, 308, 56, 16); RegisterPage.add(lblCity); city = new JTextField(); city.setBounds(241, 306, 142, 22); RegisterPage.add(city); city.setColumns(10); JLabel lblAddress_1 = new JLabel("Address 2"); lblAddress_1.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblAddress_1.setBounds(141, 263, 77, 16); RegisterPage.add(lblAddress_1); JLabel lblZip = new JLabel("Zip*"); lblZip.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblZip.setBounds(141, 402, 56, 16); RegisterPage.add(lblZip); zip = new JTextField(); zip.setBounds(241, 400, 142, 22); RegisterPage.add(zip); zip.setColumns(10); JLabel lblState = new JLabel("State*"); lblState.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblState.setBounds(141, 355, 56, 16); RegisterPage.add(lblState); state = new JTextField(); state.setBounds(241, 353, 142, 22); RegisterPage.add(state); state.setColumns(10); JLabel lblRequired = new JLabel("* = required"); lblRequired.setBounds(301, 39, 88, 16); RegisterPage.add(lblRequired); JLabel lblLicenseInfo = new JLabel("License Information"); lblLicenseInfo.setFont(new Font("Tahoma", Font.PLAIN, 16)); lblLicenseInfo.setBounds(459, 257, 148, 27); RegisterPage.add(lblLicenseInfo); JLabel lblNumber = new JLabel("Number*"); lblNumber.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNumber.setBounds(506, 310, 71, 16); RegisterPage.add(lblNumber); license = new JTextField(); license.setBounds(642, 306, 116, 22); RegisterPage.add(license); license.setColumns(10); JLabel lblDateOfBirth = new JLabel("Date of Birth*"); lblDateOfBirth.setBounds(506, 372, 88, 16); RegisterPage.add(lblDateOfBirth); birthMonth = new JComboBox(); birthMonth.setModel(new DefaultComboBoxModel(new String[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" })); birthMonth.setBounds(642, 370, 71, 22); RegisterPage.add(birthMonth); birthDay = new JComboBox(); birthDay.setModel(new DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" })); birthDay.setBounds(708, 370, 62, 22); RegisterPage.add(birthDay); List<Integer> years = new ArrayList<Integer>(); for (int i = 1915; i <= 2015; ++i) { years.add(i); } birthYear = new JComboBox(years.toArray()); birthYear.setBounds(769, 370, 97, 22); RegisterPage.add(birthYear); JButton btnContinue = new JButton("Continue ->"); btnContinue.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { register(parent); } }); btnContinue.setBounds(674, 428, 133, 34); RegisterPage.add(btnContinue); JLabel lblConfirmPassword = new JLabel("Confirm Password*"); lblConfirmPassword.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblConfirmPassword.setBounds(506, 174, 121, 16); RegisterPage.add(lblConfirmPassword); repassword = new JPasswordField(); repassword.setBounds(642, 172, 116, 22); RegisterPage.add(repassword); JLabel lblNewLabel_3 = new JLabel("Credit card #*"); lblNewLabel_3.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNewLabel_3.setBounds(141, 448, 93, 16); RegisterPage.add(lblNewLabel_3); cardNumber = new JTextField(); cardNumber.setBounds(241, 443, 142, 28); RegisterPage.add(cardNumber); cardNumber.setColumns(10); JLabel lblCardExp = new JLabel("Card exp*"); lblCardExp.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblCardExp.setBounds(141, 496, 82, 16); RegisterPage.add(lblCardExp); cardExpMonth = new JComboBox(); cardExpMonth.setModel(new DefaultComboBoxModel(new String[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" })); cardExpMonth.setBounds(238, 493, 77, 27); RegisterPage.add(cardExpMonth); cardExpDay = new JComboBox(); cardExpDay.setModel(new DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" })); cardExpDay.setBounds(312, 493, 71, 27); RegisterPage.add(cardExpDay); JLabel lblLicenseState = new JLabel("License state*"); lblLicenseState.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblLicenseState.setBounds(506, 338, 88, 16); RegisterPage.add(lblLicenseState); licenseState = new JTextField(); licenseState.setBounds(642, 333, 116, 28); RegisterPage.add(licenseState); licenseState.setColumns(10); RegisterPage.setVisible(false); }
From source file:jotp.java
public void init() { setBackground(Color.white);/*w w w . ja v a 2 s. c o m*/ setLayout(new GridLayout(6, 1)); Panel panel1 = new Panel(); add(panel1); Font titlefont = new Font("TimesRoman", Font.BOLD, 14); panel1.setFont(titlefont); panel1.add(new Label(String.valueOf(version) + ": The Java OTP (aka S/Key) calculator!")); Panel panel2 = new Panel(); panel2.setLayout(new FlowLayout()); add(panel2); panel2.add(new Label("Challenge (e.g. \"55 latour1\"):")); chaltf = new TextField(24); panel2.add(chaltf); Panel panel3 = new Panel(); panel3.setLayout(new FlowLayout()); add(panel3); panel3.add(new Label("Secret Password:")); pwtf = new TextField(24); pwtf.setEchoCharacter('*'); panel3.add(pwtf); Panel panel4 = new Panel(); panel4.setLayout(new FlowLayout()); add(panel4); panel4.add(new Button(String.valueOf(md4label))); panel4.add(new Button(String.valueOf(md5label))); Panel panel6 = new Panel(); panel6.setLayout(new FlowLayout()); add(panel6); panel6.add(new Label("One-Time Password:", Label.LEFT)); otptf = new TextField(40); panel6.add(otptf); Panel panel7 = new Panel(); add(panel7); panel7.add(new Label("jotp by Harry Mantakos, " + "http://www.cs.umd.edu/~harry/jotp")); }