List of usage examples for javax.swing DefaultComboBoxModel DefaultComboBoxModel
public DefaultComboBoxModel()
From source file:neg.JRViewerSin.java
/** This method is called from within the constructor to * initialize the form.// www . ja v a2 s . co m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; tlbToolBar = new javax.swing.JPanel(); btnPrint = new javax.swing.JButton(); btnReload = new javax.swing.JButton(); pnlSep01 = new javax.swing.JPanel(); btnFirst = new javax.swing.JButton(); btnPrevious = new javax.swing.JButton(); btnNext = new javax.swing.JButton(); btnLast = new javax.swing.JButton(); txtGoTo = new javax.swing.JTextField(); pnlSep02 = new javax.swing.JPanel(); btnActualSize = new javax.swing.JToggleButton(); btnFitPage = new javax.swing.JToggleButton(); btnFitWidth = new javax.swing.JToggleButton(); pnlSep03 = new javax.swing.JPanel(); btnZoomIn = new javax.swing.JButton(); btnZoomOut = new javax.swing.JButton(); cmbZoom = new javax.swing.JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (int i = 0; i < zooms.length; i++) { model.addElement("" + zooms[i] + "%"); } cmbZoom.setModel(model); pnlSep3 = new javax.swing.JPanel(); pnlSep4 = new javax.swing.JPanel(); pnlSep5 = new javax.swing.JPanel(); pnlSep6 = new javax.swing.JPanel(); pnlSep7 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); pnlMain = new javax.swing.JPanel(); scrollPane = new javax.swing.JScrollPane(); scrollPane.getHorizontalScrollBar().setUnitIncrement(5); scrollPane.getVerticalScrollBar().setUnitIncrement(5); pnlInScroll = new javax.swing.JPanel(); pnlPage = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); pnlLinks = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jPanel8 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel9 = new javax.swing.JPanel(); lblPage = new PageRenderer(this); pnlStatus = new javax.swing.JPanel(); lblStatus = new javax.swing.JLabel(); setMinimumSize(new java.awt.Dimension(450, 150)); setPreferredSize(new java.awt.Dimension(450, 150)); setLayout(new java.awt.BorderLayout()); tlbToolBar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 2)); btnPrint.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/print.GIF"))); // NOI18N btnPrint.setToolTipText(getBundleString("print")); btnPrint.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrint.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrint.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrint.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPrintActionPerformed(evt); } }); tlbToolBar.add(btnPrint); btnReload.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/reload.GIF"))); // NOI18N btnReload.setToolTipText(getBundleString("reload")); btnReload.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnReload.setMaximumSize(new java.awt.Dimension(23, 23)); btnReload.setMinimumSize(new java.awt.Dimension(23, 23)); btnReload.setPreferredSize(new java.awt.Dimension(23, 23)); btnReload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReloadActionPerformed(evt); } }); tlbToolBar.add(btnReload); pnlSep01.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep01); btnFirst.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/first.GIF"))); // NOI18N btnFirst.setToolTipText(getBundleString("first.page")); btnFirst.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFirst.setMaximumSize(new java.awt.Dimension(23, 23)); btnFirst.setMinimumSize(new java.awt.Dimension(23, 23)); btnFirst.setPreferredSize(new java.awt.Dimension(23, 23)); btnFirst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFirstActionPerformed(evt); } }); tlbToolBar.add(btnFirst); btnPrevious.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/previous.GIF"))); // NOI18N btnPrevious.setToolTipText(getBundleString("previous.page")); btnPrevious.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrevious.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrevious.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrevious.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPreviousActionPerformed(evt); } }); tlbToolBar.add(btnPrevious); btnNext.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/next.GIF"))); // NOI18N btnNext.setToolTipText(getBundleString("next.page")); btnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnNext.setMaximumSize(new java.awt.Dimension(23, 23)); btnNext.setMinimumSize(new java.awt.Dimension(23, 23)); btnNext.setPreferredSize(new java.awt.Dimension(23, 23)); btnNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNextActionPerformed(evt); } }); tlbToolBar.add(btnNext); btnLast.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/last.GIF"))); // NOI18N btnLast.setToolTipText(getBundleString("last.page")); btnLast.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnLast.setMaximumSize(new java.awt.Dimension(23, 23)); btnLast.setMinimumSize(new java.awt.Dimension(23, 23)); btnLast.setPreferredSize(new java.awt.Dimension(23, 23)); btnLast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLastActionPerformed(evt); } }); tlbToolBar.add(btnLast); txtGoTo.setToolTipText(getBundleString("go.to.page")); txtGoTo.setMaximumSize(new java.awt.Dimension(40, 23)); txtGoTo.setMinimumSize(new java.awt.Dimension(40, 23)); txtGoTo.setPreferredSize(new java.awt.Dimension(40, 23)); txtGoTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtGoToActionPerformed(evt); } }); tlbToolBar.add(txtGoTo); pnlSep02.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep02); btnActualSize.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/actualsize.GIF"))); // NOI18N btnActualSize.setToolTipText(getBundleString("actual.size")); btnActualSize.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnActualSize.setMaximumSize(new java.awt.Dimension(23, 23)); btnActualSize.setMinimumSize(new java.awt.Dimension(23, 23)); btnActualSize.setPreferredSize(new java.awt.Dimension(23, 23)); btnActualSize.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualSizeActionPerformed(evt); } }); tlbToolBar.add(btnActualSize); btnFitPage.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/fitpage.GIF"))); // NOI18N btnFitPage.setToolTipText(getBundleString("fit.page")); btnFitPage.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitPage.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitPage.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitPage.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitPage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitPageActionPerformed(evt); } }); tlbToolBar.add(btnFitPage); btnFitWidth.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/fitwidth.GIF"))); // NOI18N btnFitWidth.setToolTipText(getBundleString("fit.width")); btnFitWidth.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitWidth.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitWidthActionPerformed(evt); } }); tlbToolBar.add(btnFitWidth); pnlSep03.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep03); btnZoomIn.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomin.GIF"))); // NOI18N btnZoomIn.setToolTipText(getBundleString("zoom.in")); btnZoomIn.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomIn.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); tlbToolBar.add(btnZoomIn); btnZoomOut.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomout.GIF"))); // NOI18N btnZoomOut.setToolTipText(getBundleString("zoom.out")); btnZoomOut.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomOut.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); tlbToolBar.add(btnZoomOut); cmbZoom.setEditable(true); cmbZoom.setToolTipText(getBundleString("zoom.ratio")); cmbZoom.setMaximumSize(new java.awt.Dimension(80, 23)); cmbZoom.setMinimumSize(new java.awt.Dimension(80, 23)); cmbZoom.setPreferredSize(new java.awt.Dimension(80, 23)); cmbZoom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbZoomActionPerformed(evt); } }); cmbZoom.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cmbZoomItemStateChanged(evt); } }); tlbToolBar.add(cmbZoom); pnlSep3.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep3); pnlSep4.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep4); pnlSep5.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep5); pnlSep6.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep6); pnlSep7.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep7); jButton1.setForeground(new java.awt.Color(255, 0, 0)); jButton1.setText("Cancelar"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); tlbToolBar.add(jButton1); add(tlbToolBar, java.awt.BorderLayout.NORTH); pnlMain.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { pnlMainComponentResized(evt); } }); pnlMain.setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); pnlInScroll.setLayout(new java.awt.GridBagLayout()); pnlPage.setMinimumSize(new java.awt.Dimension(100, 100)); pnlPage.setPreferredSize(new java.awt.Dimension(100, 100)); pnlPage.setLayout(new java.awt.BorderLayout()); jPanel4.setMinimumSize(new java.awt.Dimension(100, 120)); jPanel4.setPreferredSize(new java.awt.Dimension(100, 120)); jPanel4.setLayout(new java.awt.GridBagLayout()); pnlLinks.setMinimumSize(new java.awt.Dimension(5, 5)); pnlLinks.setPreferredSize(new java.awt.Dimension(5, 5)); pnlLinks.setOpaque(false); pnlLinks.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnlLinksMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { pnlLinksMouseReleased(evt); } }); pnlLinks.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnlLinksMouseDragged(evt); } }); pnlLinks.setLayout(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; jPanel4.add(pnlLinks, gridBagConstraints); jPanel5.setBackground(java.awt.Color.gray); jPanel5.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel5.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; jPanel4.add(jPanel5, gridBagConstraints); jPanel6.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel6.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; jPanel4.add(jPanel6, gridBagConstraints); jPanel7.setBackground(java.awt.Color.gray); jPanel7.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel7.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; jPanel4.add(jPanel7, gridBagConstraints); jPanel8.setBackground(java.awt.Color.gray); jPanel8.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel8.setPreferredSize(new java.awt.Dimension(5, 5)); jLabel1.setText("jLabel1"); jPanel8.add(jLabel1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; jPanel4.add(jPanel8, gridBagConstraints); jPanel9.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel9.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; jPanel4.add(jPanel9, gridBagConstraints); lblPage.setBackground(java.awt.Color.white); lblPage.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblPage.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel4.add(lblPage, gridBagConstraints); pnlPage.add(jPanel4, java.awt.BorderLayout.CENTER); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); pnlInScroll.add(pnlPage, gridBagConstraints); scrollPane.setViewportView(pnlInScroll); pnlMain.add(scrollPane, java.awt.BorderLayout.CENTER); add(pnlMain, java.awt.BorderLayout.CENTER); pnlStatus.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0)); lblStatus.setFont(new java.awt.Font("Dialog", 1, 10)); lblStatus.setText("Page i of n"); pnlStatus.add(lblStatus); add(pnlStatus, java.awt.BorderLayout.SOUTH); }
From source file:gtu._work.ui.DirectoryCompareUI.java
/** * TODO/*ww w .ja v a 2s . c om*/ */ private void compareStart() { try { String leftStr = leftDirText.getText(); String rightStr = rightDirText.getText(); Validate.notBlank(leftStr, "??"); Validate.notBlank(rightStr, "???"); initComponents(); File leftFile = new File(StringUtils.trim(leftStr)); File rightFile = new File(StringUtils.trim(rightStr)); if (!leftFile.exists()) { leftFile = File.createTempFile("left_", ".txt"); if (leftFile.exists()) { leftFile.delete(); } FileUtils.write(leftFile, leftStr, "utf8"); } if (!rightFile.exists()) { rightFile = File.createTempFile("right_", ".txt"); if (rightFile.exists()) { rightFile.delete(); } FileUtils.write(rightFile, rightStr, "utf8"); } File mainFile = leftFile; File compareFile = rightFile; modelOrignList.clear(); compareSearch = new MainCompareSearch(mainFile, compareFile) { @Override void compareFileNotExists(FileZ mainFile, FileZ compareToFile, boolean mainFileIsLeft) { modelOrignList .add(getCreateRow(mainFile, compareToFile, mainFileIsLeft, DiffMergeStatus.NOT_EXISTS)); } @Override void sameFile(FileZ mainFile, FileZ compareToFile, boolean mainFileIsLeft) { modelOrignList.add(getCreateRow(mainFile, compareToFile, mainFileIsLeft, DiffMergeStatus.SAME)); } @Override void differentFile(FileZ mainFile, FileZ compareToFile, boolean mainFileIsLeft) { modelOrignList .add(getCreateRow(mainFile, compareToFile, mainFileIsLeft, DiffMergeStatus.DIFFERENT)); } @Override void complete() { DefaultTableModel dirCompareModel = getDefaultTableModel(); DefaultComboBoxModel extensionModel = new DefaultComboBoxModel(); Set<String> extensionSet = new TreeSet<String>(); for (Object[] rows : modelOrignList) { dirCompareModel.addRow(rows); InfoObj infoObj = (InfoObj) rows[0]; // ??? checkExtensionName(infoObj, extensionSet); } extensionModel.addElement(EXTENSION_ALL); extensionModel.addElement(EXTENSION_CUSTOM); for (String name : extensionSet) { extensionModel.addElement(name); } while (extensionNameComboBox.getModel().getSize() != extensionModel.getSize()) { extensionNameComboBox.setModel(extensionModel); System.out.println("reset extensionNameComboBox"); } while (dirCompareTable.getModel().getRowCount() != dirCompareModel.getRowCount()) { dirCompareTable.setModel(dirCompareModel); System.out.println("reset dirCompareTable"); } System.out.println( "extensionNameComboBox = " + (extensionNameComboBox.getModel() == extensionModel)); System.out.println("dirCompareTable = " + (dirCompareTable.getModel() == dirCompareModel)); System.out.println("extensionNameComboBox = " + extensionNameComboBox.getModel().getSize()); System.out.println("dirCompareTable = " + dirCompareTable.getModel().getRowCount()); setTitle(":" + mainFileCount + "/?:" + compareToFileCount + ", :" + completeTime); JCommonUtil._jOptionPane_showMessageDialog_info(// "???" + // "\n?:" + this.countSameFile + // "\n??:" + this.countDifferentFile + // "\n?:" + this.countNotExists + // "\n:" + completeTime + // "\n?merge:" + modelOrignList.size()); } }; if (leftFile.isDirectory() && rightFile.isDirectory()) { if (StringUtils.equals(FINDFUNCTION_ABS, String.valueOf(compareStyleComboBox.getSelectedItem()))) { compareSearch.executeSameDirectory(); } else if (StringUtils.equals(FINDFUNCTION_REL, String.valueOf(compareStyleComboBox.getSelectedItem()))) { List<File> mainFileList = new ArrayList<File>(); List<File> compareFileList = new ArrayList<File>(); FileUtil.searchFilefind(mainFile, ".*", mainFileList); FileUtil.searchFilefind(compareFile, ".*", compareFileList); compareSearch.executeTwoDirectoryButNotSame(mainFileList, compareFileList); } else { Validate.isTrue(false, "??!"); } } else if (leftFile.isFile() && rightFile.isFile()) { compareSearch.executeTwoFile(); } else if (leftFile.isDirectory() && rightFile.isFile()) { List<File> mainFileList = new ArrayList<File>(); List<File> compareFileList = new ArrayList<File>(); FileUtil.searchFilefind(mainFile, ".*", mainFileList); compareFileList.add(compareFile); compareSearch.executeTwoDirectoryButNotSame(mainFileList, compareFileList); compareStyleComboBox.setSelectedItem(FINDFUNCTION_REL); } else if (leftFile.isFile() && rightFile.isDirectory()) { List<File> mainFileList = new ArrayList<File>(); List<File> compareFileList = new ArrayList<File>(); mainFileList.add(mainFile); FileUtil.searchFilefind(compareFile, ".*", compareFileList); compareSearch.executeTwoDirectoryButNotSame(mainFileList, compareFileList); compareStyleComboBox.setSelectedItem(FINDFUNCTION_REL); } else { Validate.isTrue(false, "???!"); } } catch (Exception ex) { JCommonUtil.handleException(ex, false); } }
From source file:neg.JRViewerComercial.java
/** This method is called from within the constructor to * initialize the form.//from w w w. j av a 2 s. com * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; tlbToolBar = new javax.swing.JPanel(); btnSave = new javax.swing.JButton(); btnPrint = new javax.swing.JButton(); btnReload = new javax.swing.JButton(); pnlSep01 = new javax.swing.JPanel(); btnExcel = new javax.swing.JButton(); btnFirst = new javax.swing.JButton(); btnPrevious = new javax.swing.JButton(); btnNext = new javax.swing.JButton(); btnLast = new javax.swing.JButton(); txtGoTo = new javax.swing.JTextField(); pnlSep02 = new javax.swing.JPanel(); btnActualSize = new javax.swing.JToggleButton(); btnFitPage = new javax.swing.JToggleButton(); btnFitWidth = new javax.swing.JToggleButton(); pnlSep03 = new javax.swing.JPanel(); btnZoomIn = new javax.swing.JButton(); btnZoomOut = new javax.swing.JButton(); cmbZoom = new javax.swing.JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (int i = 0; i < zooms.length; i++) { model.addElement("" + zooms[i] + "%"); } cmbZoom.setModel(model); jButton1 = new javax.swing.JButton(); pnlMain = new javax.swing.JPanel(); scrollPane = new javax.swing.JScrollPane(); scrollPane.getHorizontalScrollBar().setUnitIncrement(5); scrollPane.getVerticalScrollBar().setUnitIncrement(5); pnlInScroll = new javax.swing.JPanel(); pnlPage = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); pnlLinks = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jPanel8 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel9 = new javax.swing.JPanel(); lblPage = new PageRenderer(this); pnlStatus = new javax.swing.JPanel(); lblStatus = new javax.swing.JLabel(); setMinimumSize(new java.awt.Dimension(450, 150)); setPreferredSize(new java.awt.Dimension(450, 150)); setLayout(new java.awt.BorderLayout()); tlbToolBar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 2)); btnSave.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/save.GIF"))); // NOI18N btnSave.setToolTipText(getBundleString("save")); btnSave.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnSave.setMaximumSize(new java.awt.Dimension(23, 23)); btnSave.setMinimumSize(new java.awt.Dimension(23, 23)); btnSave.setPreferredSize(new java.awt.Dimension(23, 23)); btnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveActionPerformed(evt); } }); tlbToolBar.add(btnSave); btnPrint.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/print.GIF"))); // NOI18N btnPrint.setToolTipText(getBundleString("print")); btnPrint.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrint.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrint.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrint.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPrintActionPerformed(evt); } }); tlbToolBar.add(btnPrint); btnReload.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/reload.GIF"))); // NOI18N btnReload.setToolTipText(getBundleString("reload")); btnReload.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnReload.setMaximumSize(new java.awt.Dimension(23, 23)); btnReload.setMinimumSize(new java.awt.Dimension(23, 23)); btnReload.setPreferredSize(new java.awt.Dimension(23, 23)); btnReload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReloadActionPerformed(evt); } }); tlbToolBar.add(btnReload); pnlSep01.setMaximumSize(new java.awt.Dimension(10, 10)); btnExcel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/excel.PNG"))); // NOI18N btnExcel.setToolTipText(getBundleString("print")); btnExcel.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnExcel.setMaximumSize(new java.awt.Dimension(23, 23)); btnExcel.setMinimumSize(new java.awt.Dimension(23, 23)); btnExcel.setPreferredSize(new java.awt.Dimension(23, 23)); btnExcel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnExcelActionPerformed(evt); } }); pnlSep01.add(btnExcel); tlbToolBar.add(pnlSep01); btnFirst.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/first.GIF"))); // NOI18N btnFirst.setToolTipText(getBundleString("first.page")); btnFirst.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFirst.setMaximumSize(new java.awt.Dimension(23, 23)); btnFirst.setMinimumSize(new java.awt.Dimension(23, 23)); btnFirst.setPreferredSize(new java.awt.Dimension(23, 23)); btnFirst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFirstActionPerformed(evt); } }); tlbToolBar.add(btnFirst); btnPrevious.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/previous.GIF"))); // NOI18N btnPrevious.setToolTipText(getBundleString("previous.page")); btnPrevious.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrevious.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrevious.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrevious.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPreviousActionPerformed(evt); } }); tlbToolBar.add(btnPrevious); btnNext.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/next.GIF"))); // NOI18N btnNext.setToolTipText(getBundleString("next.page")); btnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnNext.setMaximumSize(new java.awt.Dimension(23, 23)); btnNext.setMinimumSize(new java.awt.Dimension(23, 23)); btnNext.setPreferredSize(new java.awt.Dimension(23, 23)); btnNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNextActionPerformed(evt); } }); tlbToolBar.add(btnNext); btnLast.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/last.GIF"))); // NOI18N btnLast.setToolTipText(getBundleString("last.page")); btnLast.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnLast.setMaximumSize(new java.awt.Dimension(23, 23)); btnLast.setMinimumSize(new java.awt.Dimension(23, 23)); btnLast.setPreferredSize(new java.awt.Dimension(23, 23)); btnLast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLastActionPerformed(evt); } }); tlbToolBar.add(btnLast); txtGoTo.setToolTipText(getBundleString("go.to.page")); txtGoTo.setMaximumSize(new java.awt.Dimension(40, 23)); txtGoTo.setMinimumSize(new java.awt.Dimension(40, 23)); txtGoTo.setPreferredSize(new java.awt.Dimension(40, 23)); txtGoTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtGoToActionPerformed(evt); } }); tlbToolBar.add(txtGoTo); pnlSep02.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep02); btnActualSize.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/actualsize.GIF"))); // NOI18N btnActualSize.setToolTipText(getBundleString("actual.size")); btnActualSize.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnActualSize.setMaximumSize(new java.awt.Dimension(23, 23)); btnActualSize.setMinimumSize(new java.awt.Dimension(23, 23)); btnActualSize.setPreferredSize(new java.awt.Dimension(23, 23)); btnActualSize.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualSizeActionPerformed(evt); } }); tlbToolBar.add(btnActualSize); btnFitPage.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/fitpage.GIF"))); // NOI18N btnFitPage.setToolTipText(getBundleString("fit.page")); btnFitPage.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitPage.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitPage.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitPage.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitPage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitPageActionPerformed(evt); } }); tlbToolBar.add(btnFitPage); btnFitWidth.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/fitwidth.GIF"))); // NOI18N btnFitWidth.setToolTipText(getBundleString("fit.width")); btnFitWidth.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitWidth.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitWidthActionPerformed(evt); } }); tlbToolBar.add(btnFitWidth); pnlSep03.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep03); btnZoomIn.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomin.GIF"))); // NOI18N btnZoomIn.setToolTipText(getBundleString("zoom.in")); btnZoomIn.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomIn.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); tlbToolBar.add(btnZoomIn); btnZoomOut.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomout.GIF"))); // NOI18N btnZoomOut.setToolTipText(getBundleString("zoom.out")); btnZoomOut.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomOut.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); tlbToolBar.add(btnZoomOut); cmbZoom.setEditable(true); cmbZoom.setToolTipText(getBundleString("zoom.ratio")); cmbZoom.setMaximumSize(new java.awt.Dimension(80, 23)); cmbZoom.setMinimumSize(new java.awt.Dimension(80, 23)); cmbZoom.setPreferredSize(new java.awt.Dimension(80, 23)); cmbZoom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbZoomActionPerformed(evt); } }); cmbZoom.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cmbZoomItemStateChanged(evt); } }); tlbToolBar.add(cmbZoom); jButton1.setForeground(new java.awt.Color(255, 0, 0)); jButton1.setText("Cancelar"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); tlbToolBar.add(jButton1); add(tlbToolBar, java.awt.BorderLayout.NORTH); pnlMain.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { pnlMainComponentResized(evt); } }); pnlMain.setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); pnlInScroll.setLayout(new java.awt.GridBagLayout()); pnlPage.setMinimumSize(new java.awt.Dimension(100, 100)); pnlPage.setPreferredSize(new java.awt.Dimension(100, 100)); pnlPage.setLayout(new java.awt.BorderLayout()); jPanel4.setMinimumSize(new java.awt.Dimension(100, 120)); jPanel4.setPreferredSize(new java.awt.Dimension(100, 120)); jPanel4.setLayout(new java.awt.GridBagLayout()); pnlLinks.setMinimumSize(new java.awt.Dimension(5, 5)); pnlLinks.setPreferredSize(new java.awt.Dimension(5, 5)); pnlLinks.setOpaque(false); pnlLinks.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnlLinksMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { pnlLinksMouseReleased(evt); } }); pnlLinks.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnlLinksMouseDragged(evt); } }); pnlLinks.setLayout(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; jPanel4.add(pnlLinks, gridBagConstraints); jPanel5.setBackground(java.awt.Color.gray); jPanel5.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel5.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; jPanel4.add(jPanel5, gridBagConstraints); jPanel6.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel6.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; jPanel4.add(jPanel6, gridBagConstraints); jPanel7.setBackground(java.awt.Color.gray); jPanel7.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel7.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; jPanel4.add(jPanel7, gridBagConstraints); jPanel8.setBackground(java.awt.Color.gray); jPanel8.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel8.setPreferredSize(new java.awt.Dimension(5, 5)); jLabel1.setText("jLabel1"); jPanel8.add(jLabel1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; jPanel4.add(jPanel8, gridBagConstraints); jPanel9.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel9.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; jPanel4.add(jPanel9, gridBagConstraints); lblPage.setBackground(java.awt.Color.white); lblPage.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblPage.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel4.add(lblPage, gridBagConstraints); pnlPage.add(jPanel4, java.awt.BorderLayout.CENTER); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); pnlInScroll.add(pnlPage, gridBagConstraints); scrollPane.setViewportView(pnlInScroll); pnlMain.add(scrollPane, java.awt.BorderLayout.CENTER); add(pnlMain, java.awt.BorderLayout.CENTER); pnlStatus.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0)); lblStatus.setFont(new java.awt.Font("Dialog", 1, 10)); lblStatus.setText("Page i of n"); pnlStatus.add(lblStatus); add(pnlStatus, java.awt.BorderLayout.SOUTH); }
From source file:cn.pholance.datamanager.common.components.JRViewer.java
/** This method is called from within the constructor to * initialize the form.//from w w w . ja v a2 s. co m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; tlbToolBar = new JPanel(); btnSave = new javax.swing.JButton(); btnPrint = new javax.swing.JButton(); btnReload = new javax.swing.JButton(); pnlSep01 = new JPanel(); btnFirst = new javax.swing.JButton(); btnPrevious = new javax.swing.JButton(); btnNext = new javax.swing.JButton(); btnLast = new javax.swing.JButton(); txtGoTo = new javax.swing.JTextField(); pnlSep02 = new JPanel(); btnActualSize = new javax.swing.JToggleButton(); btnFitPage = new javax.swing.JToggleButton(); btnFitWidth = new javax.swing.JToggleButton(); pnlSep03 = new JPanel(); btnZoomIn = new javax.swing.JButton(); btnZoomOut = new javax.swing.JButton(); cmbZoom = new javax.swing.JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (int i = 0; i < zooms.length; i++) { model.addElement("" + zooms[i] + "%"); } cmbZoom.setModel(model); pnlMain = new JPanel(); scrollPane = new javax.swing.JScrollPane(); scrollPane.getHorizontalScrollBar().setUnitIncrement(5); scrollPane.getVerticalScrollBar().setUnitIncrement(5); pnlInScroll = new JPanel(); pnlPage = new JPanel(); jPanel4 = new JPanel(); pnlLinks = new JPanel(); jPanel5 = new JPanel(); jPanel6 = new JPanel(); jPanel7 = new JPanel(); jPanel8 = new JPanel(); jLabel1 = new JLabel(); jPanel9 = new JPanel(); lblPage = new PageRenderer(this); pnlStatus = new JPanel(); lblStatus = new JLabel(); setLayout(new java.awt.BorderLayout()); setMinimumSize(new Dimension(450, 150)); setPreferredSize(new Dimension(450, 150)); tlbToolBar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 2)); btnSave.setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/save.GIF"))); btnSave.setToolTipText(getBundleString("save")); btnSave.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnSave.setMaximumSize(new Dimension(23, 23)); btnSave.setMinimumSize(new Dimension(23, 23)); btnSave.setPreferredSize(new Dimension(23, 23)); btnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveActionPerformed(evt); } }); btnSave.addKeyListener(keyNavigationListener); tlbToolBar.add(btnSave); btnPrint.setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/print.GIF"))); btnPrint.setToolTipText(getBundleString("print")); btnPrint.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrint.setMaximumSize(new Dimension(23, 23)); btnPrint.setMinimumSize(new Dimension(23, 23)); btnPrint.setPreferredSize(new Dimension(23, 23)); btnPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPrintActionPerformed(evt); } }); btnPrint.addKeyListener(keyNavigationListener); tlbToolBar.add(btnPrint); btnReload.setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/reload.GIF"))); btnReload.setToolTipText(getBundleString("reload")); btnReload.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnReload.setMaximumSize(new Dimension(23, 23)); btnReload.setMinimumSize(new Dimension(23, 23)); btnReload.setPreferredSize(new Dimension(23, 23)); btnReload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReloadActionPerformed(evt); } }); btnReload.addKeyListener(keyNavigationListener); tlbToolBar.add(btnReload); pnlSep01.setMaximumSize(new Dimension(10, 10)); tlbToolBar.add(pnlSep01); btnFirst.setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/first.GIF"))); btnFirst.setToolTipText(getBundleString("first.page")); btnFirst.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFirst.setMaximumSize(new Dimension(23, 23)); btnFirst.setMinimumSize(new Dimension(23, 23)); btnFirst.setPreferredSize(new Dimension(23, 23)); btnFirst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFirstActionPerformed(evt); } }); btnFirst.addKeyListener(keyNavigationListener); tlbToolBar.add(btnFirst); btnPrevious .setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/previous.GIF"))); btnPrevious.setToolTipText(getBundleString("previous.page")); btnPrevious.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrevious.setMaximumSize(new Dimension(23, 23)); btnPrevious.setMinimumSize(new Dimension(23, 23)); btnPrevious.setPreferredSize(new Dimension(23, 23)); btnPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPreviousActionPerformed(evt); } }); btnPrevious.addKeyListener(keyNavigationListener); tlbToolBar.add(btnPrevious); btnNext.setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/next.GIF"))); btnNext.setToolTipText(getBundleString("next.page")); btnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnNext.setMaximumSize(new Dimension(23, 23)); btnNext.setMinimumSize(new Dimension(23, 23)); btnNext.setPreferredSize(new Dimension(23, 23)); btnNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNextActionPerformed(evt); } }); btnNext.addKeyListener(keyNavigationListener); tlbToolBar.add(btnNext); btnLast.setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/last.GIF"))); btnLast.setToolTipText(getBundleString("last.page")); btnLast.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnLast.setMaximumSize(new Dimension(23, 23)); btnLast.setMinimumSize(new Dimension(23, 23)); btnLast.setPreferredSize(new Dimension(23, 23)); btnLast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLastActionPerformed(evt); } }); btnLast.addKeyListener(keyNavigationListener); tlbToolBar.add(btnLast); txtGoTo.setToolTipText(getBundleString("go.to.page")); txtGoTo.setMaximumSize(new Dimension(40, 23)); txtGoTo.setMinimumSize(new Dimension(40, 23)); txtGoTo.setPreferredSize(new Dimension(40, 23)); txtGoTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtGoToActionPerformed(evt); } }); txtGoTo.addKeyListener(keyNavigationListener); tlbToolBar.add(txtGoTo); pnlSep02.setMaximumSize(new Dimension(10, 10)); tlbToolBar.add(pnlSep02); btnActualSize .setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/actualsize.GIF"))); btnActualSize.setToolTipText(getBundleString("actual.size")); btnActualSize.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnActualSize.setMaximumSize(new Dimension(23, 23)); btnActualSize.setMinimumSize(new Dimension(23, 23)); btnActualSize.setPreferredSize(new Dimension(23, 23)); btnActualSize.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualSizeActionPerformed(evt); } }); btnActualSize.addKeyListener(keyNavigationListener); tlbToolBar.add(btnActualSize); btnFitPage.setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/fitpage.GIF"))); btnFitPage.setToolTipText(getBundleString("fit.page")); btnFitPage.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitPage.setMaximumSize(new Dimension(23, 23)); btnFitPage.setMinimumSize(new Dimension(23, 23)); btnFitPage.setPreferredSize(new Dimension(23, 23)); btnFitPage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitPageActionPerformed(evt); } }); btnFitPage.addKeyListener(keyNavigationListener); tlbToolBar.add(btnFitPage); btnFitWidth .setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/fitwidth.GIF"))); btnFitWidth.setToolTipText(getBundleString("fit.width")); btnFitWidth.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitWidth.setMaximumSize(new Dimension(23, 23)); btnFitWidth.setMinimumSize(new Dimension(23, 23)); btnFitWidth.setPreferredSize(new Dimension(23, 23)); btnFitWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitWidthActionPerformed(evt); } }); btnFitWidth.addKeyListener(keyNavigationListener); tlbToolBar.add(btnFitWidth); pnlSep03.setMaximumSize(new Dimension(10, 10)); tlbToolBar.add(pnlSep03); btnZoomIn.setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomin.GIF"))); btnZoomIn.setToolTipText(getBundleString("zoom.in")); btnZoomIn.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomIn.setMaximumSize(new Dimension(23, 23)); btnZoomIn.setMinimumSize(new Dimension(23, 23)); btnZoomIn.setPreferredSize(new Dimension(23, 23)); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); btnZoomIn.addKeyListener(keyNavigationListener); tlbToolBar.add(btnZoomIn); btnZoomOut.setIcon(new ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomout.GIF"))); btnZoomOut.setToolTipText(getBundleString("zoom.out")); btnZoomOut.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomOut.setMaximumSize(new Dimension(23, 23)); btnZoomOut.setMinimumSize(new Dimension(23, 23)); btnZoomOut.setPreferredSize(new Dimension(23, 23)); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); btnZoomOut.addKeyListener(keyNavigationListener); tlbToolBar.add(btnZoomOut); cmbZoom.setEditable(true); cmbZoom.setToolTipText(getBundleString("zoom.ratio")); cmbZoom.setMaximumSize(new Dimension(80, 23)); cmbZoom.setMinimumSize(new Dimension(80, 23)); cmbZoom.setPreferredSize(new Dimension(80, 23)); cmbZoom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbZoomActionPerformed(evt); } }); cmbZoom.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cmbZoomItemStateChanged(evt); } }); cmbZoom.addKeyListener(keyNavigationListener); tlbToolBar.add(cmbZoom); add(tlbToolBar, java.awt.BorderLayout.NORTH); pnlMain.setLayout(new java.awt.BorderLayout()); pnlMain.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { pnlMainComponentResized(evt); } }); scrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); pnlInScroll.setLayout(new java.awt.GridBagLayout()); pnlPage.setLayout(new java.awt.BorderLayout()); pnlPage.setMinimumSize(new Dimension(100, 100)); pnlPage.setPreferredSize(new Dimension(100, 100)); jPanel4.setLayout(new java.awt.GridBagLayout()); jPanel4.setMinimumSize(new Dimension(100, 120)); jPanel4.setPreferredSize(new Dimension(100, 120)); pnlLinks.setLayout(null); pnlLinks.setMinimumSize(new Dimension(5, 5)); pnlLinks.setPreferredSize(new Dimension(5, 5)); pnlLinks.setOpaque(false); pnlLinks.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(MouseEvent evt) { pnlLinksMousePressed(evt); } public void mouseReleased(MouseEvent evt) { pnlLinksMouseReleased(evt); } }); pnlLinks.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(MouseEvent evt) { pnlLinksMouseDragged(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; jPanel4.add(pnlLinks, gridBagConstraints); jPanel5.setBackground(Color.gray); jPanel5.setMinimumSize(new Dimension(5, 5)); jPanel5.setPreferredSize(new Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; jPanel4.add(jPanel5, gridBagConstraints); jPanel6.setMinimumSize(new Dimension(5, 5)); jPanel6.setPreferredSize(new Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; jPanel4.add(jPanel6, gridBagConstraints); jPanel7.setBackground(Color.gray); jPanel7.setMinimumSize(new Dimension(5, 5)); jPanel7.setPreferredSize(new Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; jPanel4.add(jPanel7, gridBagConstraints); jPanel8.setBackground(Color.gray); jPanel8.setMinimumSize(new Dimension(5, 5)); jPanel8.setPreferredSize(new Dimension(5, 5)); jLabel1.setText("jLabel1"); jPanel8.add(jLabel1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; jPanel4.add(jPanel8, gridBagConstraints); jPanel9.setMinimumSize(new Dimension(5, 5)); jPanel9.setPreferredSize(new Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; jPanel4.add(jPanel9, gridBagConstraints); lblPage.setBackground(Color.white); lblPage.setBorder(new javax.swing.border.LineBorder(new Color(0, 0, 0))); lblPage.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel4.add(lblPage, gridBagConstraints); pnlPage.add(jPanel4, java.awt.BorderLayout.CENTER); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); pnlInScroll.add(pnlPage, gridBagConstraints); scrollPane.setViewportView(pnlInScroll); pnlMain.add(scrollPane, java.awt.BorderLayout.CENTER); add(pnlMain, java.awt.BorderLayout.CENTER); pnlStatus.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0)); lblStatus.setFont(new java.awt.Font("Dialog", 1, 10)); lblStatus.setText("Page i of n"); pnlStatus.add(lblStatus); add(pnlStatus, java.awt.BorderLayout.SOUTH); addKeyListener(keyNavigationListener); }
From source file:neg.JRViewerComercialProveedor.java
/** This method is called from within the constructor to * initialize the form./*from w ww. j av a 2s.c o m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; tlbToolBar = new javax.swing.JPanel(); btnSave = new javax.swing.JButton(); btnPrint = new javax.swing.JButton(); btnReload = new javax.swing.JButton(); pnlSep01 = new javax.swing.JPanel(); btnExcel = new javax.swing.JButton(); btnFirst = new javax.swing.JButton(); btnPrevious = new javax.swing.JButton(); btnNext = new javax.swing.JButton(); btnLast = new javax.swing.JButton(); txtGoTo = new javax.swing.JTextField(); pnlSep02 = new javax.swing.JPanel(); btnActualSize = new javax.swing.JToggleButton(); btnFitPage = new javax.swing.JToggleButton(); btnFitWidth = new javax.swing.JToggleButton(); pnlSep03 = new javax.swing.JPanel(); btnZoomIn = new javax.swing.JButton(); btnZoomOut = new javax.swing.JButton(); cmbZoom = new javax.swing.JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (int i = 0; i < zooms.length; i++) { model.addElement("" + zooms[i] + "%"); } cmbZoom.setModel(model); jButton1 = new javax.swing.JButton(); pnlMain = new javax.swing.JPanel(); scrollPane = new javax.swing.JScrollPane(); scrollPane.getHorizontalScrollBar().setUnitIncrement(5); scrollPane.getVerticalScrollBar().setUnitIncrement(5); pnlInScroll = new javax.swing.JPanel(); pnlPage = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); pnlLinks = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jPanel8 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel9 = new javax.swing.JPanel(); lblPage = new PageRenderer(this); pnlStatus = new javax.swing.JPanel(); lblStatus = new javax.swing.JLabel(); setMinimumSize(new java.awt.Dimension(450, 150)); setPreferredSize(new java.awt.Dimension(450, 150)); setLayout(new java.awt.BorderLayout()); tlbToolBar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 2)); btnSave.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/save.GIF"))); // NOI18N btnSave.setToolTipText(getBundleString("save")); btnSave.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnSave.setMaximumSize(new java.awt.Dimension(23, 23)); btnSave.setMinimumSize(new java.awt.Dimension(23, 23)); btnSave.setPreferredSize(new java.awt.Dimension(23, 23)); btnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveActionPerformed(evt); } }); tlbToolBar.add(btnSave); btnPrint.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/print.GIF"))); // NOI18N btnPrint.setToolTipText(getBundleString("print")); btnPrint.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrint.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrint.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrint.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPrintActionPerformed(evt); } }); tlbToolBar.add(btnPrint); btnReload.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/reload.GIF"))); // NOI18N btnReload.setToolTipText(getBundleString("reload")); btnReload.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnReload.setMaximumSize(new java.awt.Dimension(23, 23)); btnReload.setMinimumSize(new java.awt.Dimension(23, 23)); btnReload.setPreferredSize(new java.awt.Dimension(23, 23)); btnReload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReloadActionPerformed(evt); } }); tlbToolBar.add(btnReload); pnlSep01.setMaximumSize(new java.awt.Dimension(10, 10)); btnExcel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/excel.PNG"))); // NOI18N btnExcel.setToolTipText(getBundleString("print")); btnExcel.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnExcel.setMaximumSize(new java.awt.Dimension(23, 23)); btnExcel.setMinimumSize(new java.awt.Dimension(23, 23)); btnExcel.setPreferredSize(new java.awt.Dimension(23, 23)); btnExcel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnExcelActionPerformed(evt); } }); pnlSep01.add(btnExcel); tlbToolBar.add(pnlSep01); btnFirst.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/first.GIF"))); // NOI18N btnFirst.setToolTipText(getBundleString("first.page")); btnFirst.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFirst.setMaximumSize(new java.awt.Dimension(23, 23)); btnFirst.setMinimumSize(new java.awt.Dimension(23, 23)); btnFirst.setPreferredSize(new java.awt.Dimension(23, 23)); btnFirst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFirstActionPerformed(evt); } }); tlbToolBar.add(btnFirst); btnPrevious.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/previous.GIF"))); // NOI18N btnPrevious.setToolTipText(getBundleString("previous.page")); btnPrevious.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrevious.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrevious.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrevious.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPreviousActionPerformed(evt); } }); tlbToolBar.add(btnPrevious); btnNext.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/next.GIF"))); // NOI18N btnNext.setToolTipText(getBundleString("next.page")); btnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnNext.setMaximumSize(new java.awt.Dimension(23, 23)); btnNext.setMinimumSize(new java.awt.Dimension(23, 23)); btnNext.setPreferredSize(new java.awt.Dimension(23, 23)); btnNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNextActionPerformed(evt); } }); tlbToolBar.add(btnNext); btnLast.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/last.GIF"))); // NOI18N btnLast.setToolTipText(getBundleString("last.page")); btnLast.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnLast.setMaximumSize(new java.awt.Dimension(23, 23)); btnLast.setMinimumSize(new java.awt.Dimension(23, 23)); btnLast.setPreferredSize(new java.awt.Dimension(23, 23)); btnLast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLastActionPerformed(evt); } }); tlbToolBar.add(btnLast); txtGoTo.setToolTipText(getBundleString("go.to.page")); txtGoTo.setMaximumSize(new java.awt.Dimension(40, 23)); txtGoTo.setMinimumSize(new java.awt.Dimension(40, 23)); txtGoTo.setPreferredSize(new java.awt.Dimension(40, 23)); txtGoTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtGoToActionPerformed(evt); } }); tlbToolBar.add(txtGoTo); pnlSep02.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep02); btnActualSize.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/actualsize.GIF"))); // NOI18N btnActualSize.setToolTipText(getBundleString("actual.size")); btnActualSize.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnActualSize.setMaximumSize(new java.awt.Dimension(23, 23)); btnActualSize.setMinimumSize(new java.awt.Dimension(23, 23)); btnActualSize.setPreferredSize(new java.awt.Dimension(23, 23)); btnActualSize.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualSizeActionPerformed(evt); } }); tlbToolBar.add(btnActualSize); btnFitPage.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/fitpage.GIF"))); // NOI18N btnFitPage.setToolTipText(getBundleString("fit.page")); btnFitPage.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitPage.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitPage.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitPage.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitPage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitPageActionPerformed(evt); } }); tlbToolBar.add(btnFitPage); btnFitWidth.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/fitwidth.GIF"))); // NOI18N btnFitWidth.setToolTipText(getBundleString("fit.width")); btnFitWidth.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitWidth.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitWidthActionPerformed(evt); } }); tlbToolBar.add(btnFitWidth); pnlSep03.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep03); btnZoomIn.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomin.GIF"))); // NOI18N btnZoomIn.setToolTipText(getBundleString("zoom.in")); btnZoomIn.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomIn.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); tlbToolBar.add(btnZoomIn); btnZoomOut.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomout.GIF"))); // NOI18N btnZoomOut.setToolTipText(getBundleString("zoom.out")); btnZoomOut.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomOut.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); tlbToolBar.add(btnZoomOut); cmbZoom.setEditable(true); cmbZoom.setToolTipText(getBundleString("zoom.ratio")); cmbZoom.setMaximumSize(new java.awt.Dimension(80, 23)); cmbZoom.setMinimumSize(new java.awt.Dimension(80, 23)); cmbZoom.setPreferredSize(new java.awt.Dimension(80, 23)); cmbZoom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbZoomActionPerformed(evt); } }); cmbZoom.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cmbZoomItemStateChanged(evt); } }); tlbToolBar.add(cmbZoom); jButton1.setForeground(new java.awt.Color(255, 0, 0)); jButton1.setText("Cancelar"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); tlbToolBar.add(jButton1); add(tlbToolBar, java.awt.BorderLayout.NORTH); pnlMain.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { pnlMainComponentResized(evt); } }); pnlMain.setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); pnlInScroll.setLayout(new java.awt.GridBagLayout()); pnlPage.setMinimumSize(new java.awt.Dimension(100, 100)); pnlPage.setPreferredSize(new java.awt.Dimension(100, 100)); pnlPage.setLayout(new java.awt.BorderLayout()); jPanel4.setMinimumSize(new java.awt.Dimension(100, 120)); jPanel4.setPreferredSize(new java.awt.Dimension(100, 120)); jPanel4.setLayout(new java.awt.GridBagLayout()); pnlLinks.setMinimumSize(new java.awt.Dimension(5, 5)); pnlLinks.setPreferredSize(new java.awt.Dimension(5, 5)); pnlLinks.setOpaque(false); pnlLinks.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnlLinksMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { pnlLinksMouseReleased(evt); } }); pnlLinks.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnlLinksMouseDragged(evt); } }); pnlLinks.setLayout(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; jPanel4.add(pnlLinks, gridBagConstraints); jPanel5.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel5.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; jPanel4.add(jPanel5, gridBagConstraints); jPanel6.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel6.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; jPanel4.add(jPanel6, gridBagConstraints); jPanel7.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel7.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; jPanel4.add(jPanel7, gridBagConstraints); jPanel8.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel8.setPreferredSize(new java.awt.Dimension(5, 5)); jLabel1.setText("jLabel1"); jPanel8.add(jLabel1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; jPanel4.add(jPanel8, gridBagConstraints); jPanel9.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel9.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; jPanel4.add(jPanel9, gridBagConstraints); lblPage.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblPage.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel4.add(lblPage, gridBagConstraints); pnlPage.add(jPanel4, java.awt.BorderLayout.CENTER); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); pnlInScroll.add(pnlPage, gridBagConstraints); scrollPane.setViewportView(pnlInScroll); pnlMain.add(scrollPane, java.awt.BorderLayout.CENTER); add(pnlMain, java.awt.BorderLayout.CENTER); pnlStatus.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0)); lblStatus.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N lblStatus.setText("Page i of n"); pnlStatus.add(lblStatus); add(pnlStatus, java.awt.BorderLayout.SOUTH); }
From source file:neg.JRViewerFactura.java
private void iniciarComponentes(final String nombre, final BeanCorreoCliente mail, int flag) { java.awt.GridBagConstraints gridBagConstraints; tlbToolBar = new javax.swing.JPanel(); btnSave = new javax.swing.JButton(); btnPrint = new javax.swing.JButton(); btnReload = new javax.swing.JButton(); pnlSep01 = new javax.swing.JPanel(); btnFirst = new javax.swing.JButton(); btnPrevious = new javax.swing.JButton(); btnNext = new javax.swing.JButton(); btnLast = new javax.swing.JButton(); txtGoTo = new javax.swing.JTextField(); pnlSep02 = new javax.swing.JPanel(); btnActualSize = new javax.swing.JToggleButton(); btnFitPage = new javax.swing.JToggleButton(); btnFitWidth = new javax.swing.JToggleButton(); pnlSep03 = new javax.swing.JPanel(); btnZoomIn = new javax.swing.JButton(); btnZoomOut = new javax.swing.JButton(); cmbZoom = new javax.swing.JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (int i = 0; i < zooms.length; i++) { model.addElement("" + zooms[i] + "%"); }//w w w. j a v a 2s. c om cmbZoom.setModel(model); jButton1 = new javax.swing.JButton(); pnlMain = new javax.swing.JPanel(); scrollPane = new javax.swing.JScrollPane(); scrollPane.getHorizontalScrollBar().setUnitIncrement(5); scrollPane.getVerticalScrollBar().setUnitIncrement(5); pnlInScroll = new javax.swing.JPanel(); pnlPage = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); pnlLinks = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jPanel8 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel9 = new javax.swing.JPanel(); lblPage = new PageRenderer(this); pnlStatus = new javax.swing.JPanel(); lblStatus = new javax.swing.JLabel(); setMinimumSize(new java.awt.Dimension(450, 150)); setPreferredSize(new java.awt.Dimension(450, 150)); setLayout(new java.awt.BorderLayout()); tlbToolBar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 2)); btnSave.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/save.GIF"))); // NOI18N btnSave.setToolTipText(getBundleString("save")); btnSave.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnSave.setMaximumSize(new java.awt.Dimension(23, 23)); btnSave.setMinimumSize(new java.awt.Dimension(23, 23)); btnSave.setPreferredSize(new java.awt.Dimension(23, 23)); btnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveActionPerformed(evt, nombre); } }); tlbToolBar.add(btnSave); btnPrint.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/print.GIF"))); // NOI18N btnPrint.setToolTipText(getBundleString("print")); btnPrint.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrint.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrint.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrint.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPrintActionPerformed(evt); } }); tlbToolBar.add(btnPrint); if (flag == 0) { btnReload.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/mail.gif"))); // NOI18N btnReload.setToolTipText("Email"); btnReload.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnReload.setMaximumSize(new java.awt.Dimension(23, 23)); btnReload.setMinimumSize(new java.awt.Dimension(23, 23)); btnReload.setPreferredSize(new java.awt.Dimension(23, 23)); btnReload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReloadActionPerformed(evt); } private void btnReloadActionPerformed(ActionEvent evt) { Cliente finalCliente = new Cliente(); BeanCliente datosCl = new BeanCliente(); datosCl = finalCliente.getDatosFacturaCliente(finalCliente.getClienteID(mail.getCliente())); //Comprobamos si se tienen que enviar la factura por email o correo ordinario if (datosCl.getCorreo() == 1) { JLabel errorFields = new JLabel("Las facturas para el cliente " + datosCl.getNombre() + " se envan mediante correo ordinario "); JOptionPane.showMessageDialog(null, errorFields); } else { String query = "SELECT cc_nombre,cc_email FROM cc_contactos_cliente where cl_id =" + finalCliente.getClienteID(mail.getCliente()); CSDesktop.BuscaMailCliente = new JInternalFrame("Seleccionar Mail Cliente", true, false, false, true); // adjuntar panel al panel de contenido del marco interno CSSelectMailClienteFactura panel = new CSSelectMailClienteFactura(query, mail, nombre); CSDesktop.BuscaMailCliente.getContentPane().add(panel, BorderLayout.CENTER); // establecer tamao de marco interno en el tamao de su contenido CSDesktop.BuscaMailCliente.pack(); // adjuntar marco interno al escritorio y mostrarlo CSDesktop.elEscritorio.add(CSDesktop.BuscaMailCliente); CSDesktop.BuscaMailCliente.setLocation(150, 50); CSDesktop.BuscaMailCliente.setVisible(true); } } }); btnReload.setEnabled(true); tlbToolBar.add(btnReload); } pnlSep01.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep01); btnFirst.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/first.GIF"))); // NOI18N btnFirst.setToolTipText(getBundleString("first.page")); btnFirst.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFirst.setMaximumSize(new java.awt.Dimension(23, 23)); btnFirst.setMinimumSize(new java.awt.Dimension(23, 23)); btnFirst.setPreferredSize(new java.awt.Dimension(23, 23)); btnFirst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFirstActionPerformed(evt); } }); tlbToolBar.add(btnFirst); btnPrevious.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/previous.GIF"))); // NOI18N btnPrevious.setToolTipText(getBundleString("previous.page")); btnPrevious.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrevious.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrevious.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrevious.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPreviousActionPerformed(evt); } }); tlbToolBar.add(btnPrevious); btnNext.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/next.GIF"))); // NOI18N btnNext.setToolTipText(getBundleString("next.page")); btnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnNext.setMaximumSize(new java.awt.Dimension(23, 23)); btnNext.setMinimumSize(new java.awt.Dimension(23, 23)); btnNext.setPreferredSize(new java.awt.Dimension(23, 23)); btnNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNextActionPerformed(evt); } }); tlbToolBar.add(btnNext); btnLast.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/last.GIF"))); // NOI18N btnLast.setToolTipText(getBundleString("last.page")); btnLast.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnLast.setMaximumSize(new java.awt.Dimension(23, 23)); btnLast.setMinimumSize(new java.awt.Dimension(23, 23)); btnLast.setPreferredSize(new java.awt.Dimension(23, 23)); btnLast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLastActionPerformed(evt); } }); tlbToolBar.add(btnLast); txtGoTo.setToolTipText(getBundleString("go.to.page")); txtGoTo.setMaximumSize(new java.awt.Dimension(40, 23)); txtGoTo.setMinimumSize(new java.awt.Dimension(40, 23)); txtGoTo.setPreferredSize(new java.awt.Dimension(40, 23)); txtGoTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtGoToActionPerformed(evt); } }); tlbToolBar.add(txtGoTo); pnlSep02.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep02); btnActualSize.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/actualsize.GIF"))); // NOI18N btnActualSize.setToolTipText(getBundleString("actual.size")); btnActualSize.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnActualSize.setMaximumSize(new java.awt.Dimension(23, 23)); btnActualSize.setMinimumSize(new java.awt.Dimension(23, 23)); btnActualSize.setPreferredSize(new java.awt.Dimension(23, 23)); btnActualSize.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualSizeActionPerformed(evt); } }); tlbToolBar.add(btnActualSize); btnFitPage.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/fitpage.GIF"))); // NOI18N btnFitPage.setToolTipText(getBundleString("fit.page")); btnFitPage.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitPage.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitPage.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitPage.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitPage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitPageActionPerformed(evt); } }); tlbToolBar.add(btnFitPage); btnFitWidth.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/fitwidth.GIF"))); // NOI18N btnFitWidth.setToolTipText(getBundleString("fit.width")); btnFitWidth.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitWidth.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitWidthActionPerformed(evt); } }); tlbToolBar.add(btnFitWidth); pnlSep03.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep03); btnZoomIn.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomin.GIF"))); // NOI18N btnZoomIn.setToolTipText(getBundleString("zoom.in")); btnZoomIn.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomIn.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); tlbToolBar.add(btnZoomIn); btnZoomOut.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomout.GIF"))); // NOI18N btnZoomOut.setToolTipText(getBundleString("zoom.out")); btnZoomOut.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomOut.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); tlbToolBar.add(btnZoomOut); cmbZoom.setEditable(true); cmbZoom.setToolTipText(getBundleString("zoom.ratio")); cmbZoom.setMaximumSize(new java.awt.Dimension(80, 23)); cmbZoom.setMinimumSize(new java.awt.Dimension(80, 23)); cmbZoom.setPreferredSize(new java.awt.Dimension(80, 23)); cmbZoom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbZoomActionPerformed(evt); } }); cmbZoom.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cmbZoomItemStateChanged(evt); } }); tlbToolBar.add(cmbZoom); jButton1.setForeground(new java.awt.Color(255, 0, 0)); jButton1.setText("Cancelar"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); tlbToolBar.add(jButton1); add(tlbToolBar, java.awt.BorderLayout.NORTH); pnlMain.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { pnlMainComponentResized(evt); } }); pnlMain.setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); pnlInScroll.setLayout(new java.awt.GridBagLayout()); pnlPage.setMinimumSize(new java.awt.Dimension(100, 100)); pnlPage.setPreferredSize(new java.awt.Dimension(100, 100)); pnlPage.setLayout(new java.awt.BorderLayout()); jPanel4.setMinimumSize(new java.awt.Dimension(100, 120)); jPanel4.setPreferredSize(new java.awt.Dimension(100, 120)); jPanel4.setLayout(new java.awt.GridBagLayout()); pnlLinks.setMinimumSize(new java.awt.Dimension(5, 5)); pnlLinks.setPreferredSize(new java.awt.Dimension(5, 5)); pnlLinks.setOpaque(false); pnlLinks.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnlLinksMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { pnlLinksMouseReleased(evt); } }); pnlLinks.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnlLinksMouseDragged(evt); } }); pnlLinks.setLayout(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; jPanel4.add(pnlLinks, gridBagConstraints); jPanel5.setBackground(java.awt.Color.gray); jPanel5.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel5.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; jPanel4.add(jPanel5, gridBagConstraints); jPanel6.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel6.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; jPanel4.add(jPanel6, gridBagConstraints); jPanel7.setBackground(java.awt.Color.gray); jPanel7.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel7.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; jPanel4.add(jPanel7, gridBagConstraints); jPanel8.setBackground(java.awt.Color.gray); jPanel8.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel8.setPreferredSize(new java.awt.Dimension(5, 5)); jLabel1.setText("jLabel1"); jPanel8.add(jLabel1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; jPanel4.add(jPanel8, gridBagConstraints); jPanel9.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel9.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; jPanel4.add(jPanel9, gridBagConstraints); lblPage.setBackground(java.awt.Color.white); lblPage.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblPage.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel4.add(lblPage, gridBagConstraints); pnlPage.add(jPanel4, java.awt.BorderLayout.CENTER); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); pnlInScroll.add(pnlPage, gridBagConstraints); scrollPane.setViewportView(pnlInScroll); pnlMain.add(scrollPane, java.awt.BorderLayout.CENTER); add(pnlMain, java.awt.BorderLayout.CENTER); pnlStatus.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0)); lblStatus.setFont(new java.awt.Font("Dialog", 1, 10)); lblStatus.setText("Page i of n"); pnlStatus.add(lblStatus); add(pnlStatus, java.awt.BorderLayout.SOUTH); }
From source file:neg.JRViewerInformeUnitario.java
/** This method is called from within the constructor to * initialize the form./*from ww w . j a va 2 s . c o m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; tlbToolBar = new javax.swing.JPanel(); btnSave = new javax.swing.JButton(); btnPrint = new javax.swing.JButton(); btnReload = new javax.swing.JButton(); pnlSep01 = new javax.swing.JPanel(); btnExcel = new javax.swing.JButton(); btnFirst = new javax.swing.JButton(); btnPrevious = new javax.swing.JButton(); btnNext = new javax.swing.JButton(); btnLast = new javax.swing.JButton(); txtGoTo = new javax.swing.JTextField(); pnlSep02 = new javax.swing.JPanel(); btnActualSize = new javax.swing.JToggleButton(); btnFitPage = new javax.swing.JToggleButton(); btnFitWidth = new javax.swing.JToggleButton(); pnlSep03 = new javax.swing.JPanel(); btnZoomIn = new javax.swing.JButton(); btnZoomOut = new javax.swing.JButton(); cmbZoom = new javax.swing.JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (int i = 0; i < zooms.length; i++) { model.addElement("" + zooms[i] + "%"); } cmbZoom.setModel(model); jButton1 = new javax.swing.JButton(); pnlMain = new javax.swing.JPanel(); scrollPane = new javax.swing.JScrollPane(); scrollPane.getHorizontalScrollBar().setUnitIncrement(5); scrollPane.getVerticalScrollBar().setUnitIncrement(5); pnlInScroll = new javax.swing.JPanel(); pnlPage = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); pnlLinks = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jPanel8 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel9 = new javax.swing.JPanel(); lblPage = new PageRenderer(this); pnlStatus = new javax.swing.JPanel(); lblStatus = new javax.swing.JLabel(); setMinimumSize(new java.awt.Dimension(450, 150)); setPreferredSize(new java.awt.Dimension(450, 150)); setLayout(new java.awt.BorderLayout()); tlbToolBar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 2)); btnSave.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/save.GIF"))); // NOI18N btnSave.setToolTipText(getBundleString("save")); btnSave.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnSave.setMaximumSize(new java.awt.Dimension(23, 23)); btnSave.setMinimumSize(new java.awt.Dimension(23, 23)); btnSave.setPreferredSize(new java.awt.Dimension(23, 23)); btnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveActionPerformed(evt); } }); tlbToolBar.add(btnSave); btnPrint.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/print.GIF"))); // NOI18N btnPrint.setToolTipText(getBundleString("print")); btnPrint.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrint.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrint.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrint.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPrintActionPerformed(evt); } }); tlbToolBar.add(btnPrint); btnReload.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/reload.GIF"))); // NOI18N btnReload.setToolTipText(getBundleString("reload")); btnReload.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnReload.setMaximumSize(new java.awt.Dimension(23, 23)); btnReload.setMinimumSize(new java.awt.Dimension(23, 23)); btnReload.setPreferredSize(new java.awt.Dimension(23, 23)); btnReload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReloadActionPerformed(evt); } }); tlbToolBar.add(btnReload); pnlSep01.setMaximumSize(new java.awt.Dimension(10, 10)); btnExcel.setToolTipText(getBundleString("print")); btnExcel.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnExcel.setMaximumSize(new java.awt.Dimension(23, 23)); btnExcel.setMinimumSize(new java.awt.Dimension(23, 23)); btnExcel.setPreferredSize(new java.awt.Dimension(23, 23)); btnExcel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnExcelActionPerformed(evt); } }); pnlSep01.add(btnExcel); tlbToolBar.add(pnlSep01); btnFirst.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/first.GIF"))); // NOI18N btnFirst.setToolTipText(getBundleString("first.page")); btnFirst.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFirst.setMaximumSize(new java.awt.Dimension(23, 23)); btnFirst.setMinimumSize(new java.awt.Dimension(23, 23)); btnFirst.setPreferredSize(new java.awt.Dimension(23, 23)); btnFirst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFirstActionPerformed(evt); } }); tlbToolBar.add(btnFirst); btnPrevious.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/previous.GIF"))); // NOI18N btnPrevious.setToolTipText(getBundleString("previous.page")); btnPrevious.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrevious.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrevious.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrevious.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPreviousActionPerformed(evt); } }); tlbToolBar.add(btnPrevious); btnNext.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/next.GIF"))); // NOI18N btnNext.setToolTipText(getBundleString("next.page")); btnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnNext.setMaximumSize(new java.awt.Dimension(23, 23)); btnNext.setMinimumSize(new java.awt.Dimension(23, 23)); btnNext.setPreferredSize(new java.awt.Dimension(23, 23)); btnNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNextActionPerformed(evt); } }); tlbToolBar.add(btnNext); btnLast.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/last.GIF"))); // NOI18N btnLast.setToolTipText(getBundleString("last.page")); btnLast.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnLast.setMaximumSize(new java.awt.Dimension(23, 23)); btnLast.setMinimumSize(new java.awt.Dimension(23, 23)); btnLast.setPreferredSize(new java.awt.Dimension(23, 23)); btnLast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLastActionPerformed(evt); } }); tlbToolBar.add(btnLast); txtGoTo.setToolTipText(getBundleString("go.to.page")); txtGoTo.setMaximumSize(new java.awt.Dimension(40, 23)); txtGoTo.setMinimumSize(new java.awt.Dimension(40, 23)); txtGoTo.setPreferredSize(new java.awt.Dimension(40, 23)); txtGoTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtGoToActionPerformed(evt); } }); tlbToolBar.add(txtGoTo); pnlSep02.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep02); btnActualSize.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/actualsize.GIF"))); // NOI18N btnActualSize.setToolTipText(getBundleString("actual.size")); btnActualSize.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnActualSize.setMaximumSize(new java.awt.Dimension(23, 23)); btnActualSize.setMinimumSize(new java.awt.Dimension(23, 23)); btnActualSize.setPreferredSize(new java.awt.Dimension(23, 23)); btnActualSize.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualSizeActionPerformed(evt); } }); tlbToolBar.add(btnActualSize); btnFitPage.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/fitpage.GIF"))); // NOI18N btnFitPage.setToolTipText(getBundleString("fit.page")); btnFitPage.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitPage.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitPage.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitPage.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitPage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitPageActionPerformed(evt); } }); tlbToolBar.add(btnFitPage); btnFitWidth.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/fitwidth.GIF"))); // NOI18N btnFitWidth.setToolTipText(getBundleString("fit.width")); btnFitWidth.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitWidth.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitWidthActionPerformed(evt); } }); tlbToolBar.add(btnFitWidth); pnlSep03.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep03); btnZoomIn.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomin.GIF"))); // NOI18N btnZoomIn.setToolTipText(getBundleString("zoom.in")); btnZoomIn.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomIn.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); tlbToolBar.add(btnZoomIn); btnZoomOut.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomout.GIF"))); // NOI18N btnZoomOut.setToolTipText(getBundleString("zoom.out")); btnZoomOut.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomOut.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); tlbToolBar.add(btnZoomOut); cmbZoom.setEditable(true); cmbZoom.setToolTipText(getBundleString("zoom.ratio")); cmbZoom.setMaximumSize(new java.awt.Dimension(80, 23)); cmbZoom.setMinimumSize(new java.awt.Dimension(80, 23)); cmbZoom.setPreferredSize(new java.awt.Dimension(80, 23)); cmbZoom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbZoomActionPerformed(evt); } }); cmbZoom.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cmbZoomItemStateChanged(evt); } }); tlbToolBar.add(cmbZoom); jButton1.setForeground(new java.awt.Color(255, 0, 0)); jButton1.setText("Cancelar"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); tlbToolBar.add(jButton1); add(tlbToolBar, java.awt.BorderLayout.NORTH); pnlMain.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { pnlMainComponentResized(evt); } }); pnlMain.setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); pnlInScroll.setLayout(new java.awt.GridBagLayout()); pnlPage.setMinimumSize(new java.awt.Dimension(100, 100)); pnlPage.setPreferredSize(new java.awt.Dimension(100, 100)); pnlPage.setLayout(new java.awt.BorderLayout()); jPanel4.setMinimumSize(new java.awt.Dimension(100, 120)); jPanel4.setPreferredSize(new java.awt.Dimension(100, 120)); jPanel4.setLayout(new java.awt.GridBagLayout()); pnlLinks.setMinimumSize(new java.awt.Dimension(5, 5)); pnlLinks.setPreferredSize(new java.awt.Dimension(5, 5)); pnlLinks.setOpaque(false); pnlLinks.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnlLinksMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { pnlLinksMouseReleased(evt); } }); pnlLinks.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnlLinksMouseDragged(evt); } }); pnlLinks.setLayout(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; jPanel4.add(pnlLinks, gridBagConstraints); jPanel5.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel5.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; jPanel4.add(jPanel5, gridBagConstraints); jPanel6.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel6.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; jPanel4.add(jPanel6, gridBagConstraints); jPanel7.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel7.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; jPanel4.add(jPanel7, gridBagConstraints); jPanel8.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel8.setPreferredSize(new java.awt.Dimension(5, 5)); jLabel1.setText("jLabel1"); jPanel8.add(jLabel1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; jPanel4.add(jPanel8, gridBagConstraints); jPanel9.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel9.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; jPanel4.add(jPanel9, gridBagConstraints); lblPage.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblPage.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel4.add(lblPage, gridBagConstraints); pnlPage.add(jPanel4, java.awt.BorderLayout.CENTER); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); pnlInScroll.add(pnlPage, gridBagConstraints); scrollPane.setViewportView(pnlInScroll); pnlMain.add(scrollPane, java.awt.BorderLayout.CENTER); add(pnlMain, java.awt.BorderLayout.CENTER); pnlStatus.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0)); lblStatus.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N lblStatus.setText("Page i of n"); pnlStatus.add(lblStatus); add(pnlStatus, java.awt.BorderLayout.SOUTH); }
From source file:com.openbravo.pos.util.JRViewer411.java
/** This method is called from within the constructor to * initialize the form.//from w w w.j av a2 s . com * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; pnlMain = new javax.swing.JPanel(); scrollPane = new javax.swing.JScrollPane(); scrollPane.getHorizontalScrollBar().setUnitIncrement(5); scrollPane.getVerticalScrollBar().setUnitIncrement(5); pnlInScroll = new javax.swing.JPanel(); pnlPage = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); pnlLinks = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jPanel8 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel9 = new javax.swing.JPanel(); lblPage = new PageRenderer(this); jToolBar = new javax.swing.JToolBar(); btnSave = new javax.swing.JButton(); btnPrint = new javax.swing.JButton(); btnReload = new javax.swing.JButton(); jSeparator1 = new javax.swing.JToolBar.Separator(); btnActualSize = new javax.swing.JToggleButton(); btnFitPage = new javax.swing.JToggleButton(); btnFitWidth = new javax.swing.JToggleButton(); jSeparator2 = new javax.swing.JToolBar.Separator(); btnZoomIn = new javax.swing.JButton(); cmbZoom = new javax.swing.JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (int i = 0; i < zooms.length; i++) { model.addElement("" + zooms[i] + "%"); } cmbZoom.setModel(model); btnZoomOut = new javax.swing.JButton(); jSeparator3 = new javax.swing.JToolBar.Separator(); btnFirst = new javax.swing.JButton(); btnPrevious = new javax.swing.JButton(); txtGoTo = new javax.swing.JTextField(); btnNext = new javax.swing.JButton(); btnLast = new javax.swing.JButton(); jSeparator4 = new javax.swing.JToolBar.Separator(); lblStatus = new javax.swing.JLabel(); setMinimumSize(new java.awt.Dimension(450, 150)); setPreferredSize(new java.awt.Dimension(450, 150)); setLayout(new java.awt.BorderLayout()); pnlMain.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { pnlMainComponentResized(evt); } }); pnlMain.setLayout(new java.awt.BorderLayout()); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); pnlInScroll.setLayout(new java.awt.GridBagLayout()); pnlPage.setMinimumSize(new java.awt.Dimension(100, 100)); pnlPage.setPreferredSize(new java.awt.Dimension(100, 100)); pnlPage.setLayout(new java.awt.BorderLayout()); jPanel4.setMinimumSize(new java.awt.Dimension(100, 120)); jPanel4.setPreferredSize(new java.awt.Dimension(100, 120)); jPanel4.setLayout(new java.awt.GridBagLayout()); pnlLinks.setMinimumSize(new java.awt.Dimension(5, 5)); pnlLinks.setOpaque(false); pnlLinks.setPreferredSize(new java.awt.Dimension(5, 5)); pnlLinks.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnlLinksMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { pnlLinksMouseReleased(evt); } }); pnlLinks.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnlLinksMouseDragged(evt); } }); pnlLinks.setLayout(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; jPanel4.add(pnlLinks, gridBagConstraints); jPanel5.setBackground(java.awt.Color.gray); jPanel5.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel5.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; jPanel4.add(jPanel5, gridBagConstraints); jPanel6.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel6.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; jPanel4.add(jPanel6, gridBagConstraints); jPanel7.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel7.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; jPanel4.add(jPanel7, gridBagConstraints); jPanel8.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel8.setPreferredSize(new java.awt.Dimension(5, 5)); jLabel1.setText("jLabel1"); jPanel8.add(jLabel1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; jPanel4.add(jPanel8, gridBagConstraints); jPanel9.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel9.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; jPanel4.add(jPanel9, gridBagConstraints); lblPage.setBackground(java.awt.Color.white); lblPage.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblPage.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel4.add(lblPage, gridBagConstraints); pnlPage.add(jPanel4, java.awt.BorderLayout.CENTER); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); pnlInScroll.add(pnlPage, gridBagConstraints); scrollPane.setViewportView(pnlInScroll); pnlMain.add(scrollPane, java.awt.BorderLayout.CENTER); jToolBar.setFloatable(false); jToolBar.setOpaque(false); btnSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/filesave.png"))); // NOI18N btnSave.setToolTipText(getBundleString("save")); btnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveActionPerformed(evt); } }); jToolBar.add(btnSave); btnPrint.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/yast_printer.png"))); // NOI18N btnPrint.setToolTipText(getBundleString("print")); btnPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPrintActionPerformed(evt); } }); jToolBar.add(btnPrint); btnReload.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/reload.png"))); // NOI18N btnReload.setToolTipText(getBundleString("reload")); btnReload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReloadActionPerformed(evt); } }); jToolBar.add(btnReload); jToolBar.add(jSeparator1); btnActualSize.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/mime.png"))); // NOI18N btnActualSize.setToolTipText(getBundleString("actual.size")); btnActualSize.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualSizeActionPerformed(evt); } }); jToolBar.add(btnActualSize); btnFitPage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/mime2.png"))); // NOI18N btnFitPage.setToolTipText(getBundleString("fit.page")); btnFitPage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitPageActionPerformed(evt); } }); jToolBar.add(btnFitPage); btnFitWidth.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/mime3.png"))); // NOI18N btnFitWidth.setToolTipText(getBundleString("fit.width")); btnFitWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitWidthActionPerformed(evt); } }); jToolBar.add(btnFitWidth); jToolBar.add(jSeparator2); btnZoomIn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/viewmag+.png"))); // NOI18N btnZoomIn.setToolTipText(getBundleString("zoom.in")); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); jToolBar.add(btnZoomIn); cmbZoom.setEditable(true); cmbZoom.setToolTipText(getBundleString("zoom.ratio")); cmbZoom.setMaximumSize(new java.awt.Dimension(80, 23)); cmbZoom.setMinimumSize(new java.awt.Dimension(80, 23)); cmbZoom.setPreferredSize(new java.awt.Dimension(80, 23)); cmbZoom.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cmbZoomItemStateChanged(evt); } }); cmbZoom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbZoomActionPerformed(evt); } }); jToolBar.add(cmbZoom); btnZoomOut.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/viewmag-.png"))); // NOI18N btnZoomOut.setToolTipText(getBundleString("zoom.out")); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); jToolBar.add(btnZoomOut); jToolBar.add(jSeparator3); btnFirst.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/2leftarrow.png"))); // NOI18N btnFirst.setToolTipText(getBundleString("first.page")); btnFirst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFirstActionPerformed(evt); } }); jToolBar.add(btnFirst); btnPrevious .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1leftarrow.png"))); // NOI18N btnPrevious.setToolTipText(getBundleString("previous.page")); btnPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPreviousActionPerformed(evt); } }); jToolBar.add(btnPrevious); txtGoTo.setToolTipText(getBundleString("go.to.page")); txtGoTo.setMaximumSize(new java.awt.Dimension(40, 23)); txtGoTo.setMinimumSize(new java.awt.Dimension(40, 23)); txtGoTo.setPreferredSize(new java.awt.Dimension(40, 23)); txtGoTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtGoToActionPerformed(evt); } }); jToolBar.add(txtGoTo); btnNext.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1rightarrow.png"))); // NOI18N btnNext.setToolTipText(getBundleString("next.page")); btnNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNextActionPerformed(evt); } }); jToolBar.add(btnNext); btnLast.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/2rightarrow.png"))); // NOI18N btnLast.setToolTipText(getBundleString("last.page")); btnLast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLastActionPerformed(evt); } }); jToolBar.add(btnLast); jToolBar.add(jSeparator4); lblStatus.setText("Page i of n"); jToolBar.add(lblStatus); pnlMain.add(jToolBar, java.awt.BorderLayout.NORTH); add(pnlMain, java.awt.BorderLayout.CENTER); }
From source file:ireport_5_6_0.view.JRViewer.java
/** This method is called from within the constructor to * initialize the form.//from w w w .jav a 2 s . c om * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; tlbToolBar = new javax.swing.JPanel(); btnSave = new javax.swing.JButton(); btnPrint = new javax.swing.JButton(); btnReload = new javax.swing.JButton(); pnlSep01 = new javax.swing.JPanel(); btnFirst = new javax.swing.JButton(); btnPrevious = new javax.swing.JButton(); btnNext = new javax.swing.JButton(); btnLast = new javax.swing.JButton(); txtGoTo = new javax.swing.JTextField(); pnlSep02 = new javax.swing.JPanel(); btnActualSize = new javax.swing.JToggleButton(); btnFitPage = new javax.swing.JToggleButton(); btnFitWidth = new javax.swing.JToggleButton(); pnlSep03 = new javax.swing.JPanel(); btnZoomIn = new javax.swing.JButton(); btnZoomOut = new javax.swing.JButton(); cmbZoom = new javax.swing.JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (int i = 0; i < zooms.length; i++) { model.addElement("" + zooms[i] + "%"); } cmbZoom.setModel(model); pnlMain = new javax.swing.JPanel(); scrollPane = new javax.swing.JScrollPane(); scrollPane.getHorizontalScrollBar().setUnitIncrement(5); scrollPane.getVerticalScrollBar().setUnitIncrement(5); pnlInScroll = new javax.swing.JPanel(); pnlPage = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); pnlLinks = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jPanel8 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel9 = new javax.swing.JPanel(); lblPage = new PageRenderer(this); pnlStatus = new javax.swing.JPanel(); lblStatus = new javax.swing.JLabel(); setLayout(new java.awt.BorderLayout()); setMinimumSize(new java.awt.Dimension(450, 150)); setPreferredSize(new java.awt.Dimension(450, 150)); tlbToolBar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 2)); btnSave.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/save.GIF"))); btnSave.setToolTipText(getBundleString("save")); btnSave.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnSave.setMaximumSize(new java.awt.Dimension(23, 23)); btnSave.setMinimumSize(new java.awt.Dimension(23, 23)); btnSave.setPreferredSize(new java.awt.Dimension(23, 23)); btnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveActionPerformed(evt); } }); btnSave.addKeyListener(keyNavigationListener); tlbToolBar.add(btnSave); btnPrint.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/print.GIF"))); btnPrint.setToolTipText(getBundleString("print")); btnPrint.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrint.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrint.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrint.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPrintActionPerformed(evt); } }); btnPrint.addKeyListener(keyNavigationListener); tlbToolBar.add(btnPrint); btnReload.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/reload.GIF"))); btnReload.setToolTipText(getBundleString("reload")); btnReload.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnReload.setMaximumSize(new java.awt.Dimension(23, 23)); btnReload.setMinimumSize(new java.awt.Dimension(23, 23)); btnReload.setPreferredSize(new java.awt.Dimension(23, 23)); btnReload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReloadActionPerformed(evt); } }); btnReload.addKeyListener(keyNavigationListener); tlbToolBar.add(btnReload); pnlSep01.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep01); btnFirst.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/first.GIF"))); btnFirst.setToolTipText(getBundleString("first.page")); btnFirst.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFirst.setMaximumSize(new java.awt.Dimension(23, 23)); btnFirst.setMinimumSize(new java.awt.Dimension(23, 23)); btnFirst.setPreferredSize(new java.awt.Dimension(23, 23)); btnFirst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFirstActionPerformed(evt); } }); btnFirst.addKeyListener(keyNavigationListener); tlbToolBar.add(btnFirst); btnPrevious.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/previous.GIF"))); btnPrevious.setToolTipText(getBundleString("previous.page")); btnPrevious.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrevious.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrevious.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrevious.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPreviousActionPerformed(evt); } }); btnPrevious.addKeyListener(keyNavigationListener); tlbToolBar.add(btnPrevious); btnNext.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/next.GIF"))); btnNext.setToolTipText(getBundleString("next.page")); btnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnNext.setMaximumSize(new java.awt.Dimension(23, 23)); btnNext.setMinimumSize(new java.awt.Dimension(23, 23)); btnNext.setPreferredSize(new java.awt.Dimension(23, 23)); btnNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNextActionPerformed(evt); } }); btnNext.addKeyListener(keyNavigationListener); tlbToolBar.add(btnNext); btnLast.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/last.GIF"))); btnLast.setToolTipText(getBundleString("last.page")); btnLast.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnLast.setMaximumSize(new java.awt.Dimension(23, 23)); btnLast.setMinimumSize(new java.awt.Dimension(23, 23)); btnLast.setPreferredSize(new java.awt.Dimension(23, 23)); btnLast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLastActionPerformed(evt); } }); btnLast.addKeyListener(keyNavigationListener); tlbToolBar.add(btnLast); txtGoTo.setToolTipText(getBundleString("go.to.page")); txtGoTo.setMaximumSize(new java.awt.Dimension(40, 23)); txtGoTo.setMinimumSize(new java.awt.Dimension(40, 23)); txtGoTo.setPreferredSize(new java.awt.Dimension(40, 23)); txtGoTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtGoToActionPerformed(evt); } }); txtGoTo.addKeyListener(keyNavigationListener); tlbToolBar.add(txtGoTo); pnlSep02.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep02); btnActualSize.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/actualsize.GIF"))); btnActualSize.setToolTipText(getBundleString("actual.size")); btnActualSize.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnActualSize.setMaximumSize(new java.awt.Dimension(23, 23)); btnActualSize.setMinimumSize(new java.awt.Dimension(23, 23)); btnActualSize.setPreferredSize(new java.awt.Dimension(23, 23)); btnActualSize.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualSizeActionPerformed(evt); } }); btnActualSize.addKeyListener(keyNavigationListener); tlbToolBar.add(btnActualSize); btnFitPage.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/fitpage.GIF"))); btnFitPage.setToolTipText(getBundleString("fit.page")); btnFitPage.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitPage.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitPage.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitPage.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitPage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitPageActionPerformed(evt); } }); btnFitPage.addKeyListener(keyNavigationListener); tlbToolBar.add(btnFitPage); btnFitWidth.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/fitwidth.GIF"))); btnFitWidth.setToolTipText(getBundleString("fit.width")); btnFitWidth.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitWidth.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitWidthActionPerformed(evt); } }); btnFitWidth.addKeyListener(keyNavigationListener); tlbToolBar.add(btnFitWidth); pnlSep03.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep03); btnZoomIn.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomin.GIF"))); btnZoomIn.setToolTipText(getBundleString("zoom.in")); btnZoomIn.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomIn.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); btnZoomIn.addKeyListener(keyNavigationListener); tlbToolBar.add(btnZoomIn); btnZoomOut.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomout.GIF"))); btnZoomOut.setToolTipText(getBundleString("zoom.out")); btnZoomOut.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomOut.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); btnZoomOut.addKeyListener(keyNavigationListener); tlbToolBar.add(btnZoomOut); cmbZoom.setEditable(true); cmbZoom.setToolTipText(getBundleString("zoom.ratio")); cmbZoom.setMaximumSize(new java.awt.Dimension(80, 23)); cmbZoom.setMinimumSize(new java.awt.Dimension(80, 23)); cmbZoom.setPreferredSize(new java.awt.Dimension(80, 23)); cmbZoom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbZoomActionPerformed(evt); } }); cmbZoom.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cmbZoomItemStateChanged(evt); } }); cmbZoom.addKeyListener(keyNavigationListener); tlbToolBar.add(cmbZoom); add(tlbToolBar, java.awt.BorderLayout.NORTH); pnlMain.setLayout(new java.awt.BorderLayout()); pnlMain.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { pnlMainComponentResized(evt); } }); scrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); pnlInScroll.setLayout(new java.awt.GridBagLayout()); pnlPage.setLayout(new java.awt.BorderLayout()); pnlPage.setMinimumSize(new java.awt.Dimension(100, 100)); pnlPage.setPreferredSize(new java.awt.Dimension(100, 100)); jPanel4.setLayout(new java.awt.GridBagLayout()); jPanel4.setMinimumSize(new java.awt.Dimension(100, 120)); jPanel4.setPreferredSize(new java.awt.Dimension(100, 120)); pnlLinks.setLayout(null); pnlLinks.setMinimumSize(new java.awt.Dimension(5, 5)); pnlLinks.setPreferredSize(new java.awt.Dimension(5, 5)); pnlLinks.setOpaque(false); pnlLinks.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnlLinksMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { pnlLinksMouseReleased(evt); } }); pnlLinks.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnlLinksMouseDragged(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; jPanel4.add(pnlLinks, gridBagConstraints); jPanel5.setBackground(java.awt.Color.gray); jPanel5.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel5.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; jPanel4.add(jPanel5, gridBagConstraints); jPanel6.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel6.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; jPanel4.add(jPanel6, gridBagConstraints); jPanel7.setBackground(java.awt.Color.gray); jPanel7.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel7.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; jPanel4.add(jPanel7, gridBagConstraints); jPanel8.setBackground(java.awt.Color.gray); jPanel8.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel8.setPreferredSize(new java.awt.Dimension(5, 5)); jLabel1.setText("jLabel1"); jPanel8.add(jLabel1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; jPanel4.add(jPanel8, gridBagConstraints); jPanel9.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel9.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; jPanel4.add(jPanel9, gridBagConstraints); lblPage.setBackground(java.awt.Color.white); lblPage.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0))); lblPage.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel4.add(lblPage, gridBagConstraints); pnlPage.add(jPanel4, java.awt.BorderLayout.CENTER); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); pnlInScroll.add(pnlPage, gridBagConstraints); scrollPane.setViewportView(pnlInScroll); pnlMain.add(scrollPane, java.awt.BorderLayout.CENTER); add(pnlMain, java.awt.BorderLayout.CENTER); pnlStatus.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0)); lblStatus.setFont(new java.awt.Font("Dialog", 1, 10)); lblStatus.setText("Page i of n"); pnlStatus.add(lblStatus); add(pnlStatus, java.awt.BorderLayout.SOUTH); addKeyListener(keyNavigationListener); }
From source file:net.sf.jasperreports.view.JRViewer.java
/** This method is called from within the constructor to * initialize the form./*from w w w.ja va 2 s . co m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; tlbToolBar = new javax.swing.JPanel(); btnSave = new javax.swing.JButton(); btnPrint = new javax.swing.JButton(); btnReload = new javax.swing.JButton(); pnlSep01 = new javax.swing.JPanel(); btnFirst = new javax.swing.JButton(); btnPrevious = new javax.swing.JButton(); btnNext = new javax.swing.JButton(); btnLast = new javax.swing.JButton(); txtGoTo = new javax.swing.JTextField(); pnlSep02 = new javax.swing.JPanel(); btnActualSize = new javax.swing.JToggleButton(); btnFitPage = new javax.swing.JToggleButton(); btnFitWidth = new javax.swing.JToggleButton(); pnlSep03 = new javax.swing.JPanel(); btnZoomIn = new javax.swing.JButton(); btnZoomOut = new javax.swing.JButton(); cmbZoom = new javax.swing.JComboBox(); DefaultComboBoxModel model = new DefaultComboBoxModel(); for (int i = 0; i < zooms.length; i++) { model.addElement("" + zooms[i] + "%"); } cmbZoom.setModel(model); pnlMain = new javax.swing.JPanel(); pnlTabs = new javax.swing.JTabbedPane(); scrollPane = new javax.swing.JScrollPane(); scrollPane.getHorizontalScrollBar().setUnitIncrement(5); scrollPane.getVerticalScrollBar().setUnitIncrement(5); pnlInScroll = new javax.swing.JPanel(); pnlPage = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); pnlLinks = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jPanel8 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel9 = new javax.swing.JPanel(); lblPage = new PageRenderer(this); pnlStatus = new javax.swing.JPanel(); lblStatus = new javax.swing.JLabel(); setMinimumSize(new java.awt.Dimension(450, 150)); setPreferredSize(new java.awt.Dimension(450, 150)); setLayout(new java.awt.BorderLayout()); tlbToolBar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 2)); btnSave.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/save.GIF"))); // NOI18N btnSave.setToolTipText(getBundleString("save")); btnSave.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnSave.setMaximumSize(new java.awt.Dimension(23, 23)); btnSave.setMinimumSize(new java.awt.Dimension(23, 23)); btnSave.setPreferredSize(new java.awt.Dimension(23, 23)); btnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveActionPerformed(evt); } }); btnSave.addKeyListener(keyNavigationListener); tlbToolBar.add(btnSave); btnPrint.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/print.GIF"))); // NOI18N btnPrint.setToolTipText(getBundleString("print")); btnPrint.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrint.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrint.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrint.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPrintActionPerformed(evt); } }); btnPrint.addKeyListener(keyNavigationListener); tlbToolBar.add(btnPrint); btnReload.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/reload.GIF"))); // NOI18N btnReload.setToolTipText(getBundleString("reload")); btnReload.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnReload.setMaximumSize(new java.awt.Dimension(23, 23)); btnReload.setMinimumSize(new java.awt.Dimension(23, 23)); btnReload.setPreferredSize(new java.awt.Dimension(23, 23)); btnReload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReloadActionPerformed(evt); } }); btnReload.addKeyListener(keyNavigationListener); tlbToolBar.add(btnReload); pnlSep01.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep01); btnFirst.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/first.GIF"))); // NOI18N btnFirst.setToolTipText(getBundleString("first.page")); btnFirst.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFirst.setMaximumSize(new java.awt.Dimension(23, 23)); btnFirst.setMinimumSize(new java.awt.Dimension(23, 23)); btnFirst.setPreferredSize(new java.awt.Dimension(23, 23)); btnFirst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFirstActionPerformed(evt); } }); btnFirst.addKeyListener(keyNavigationListener); tlbToolBar.add(btnFirst); btnPrevious.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/previous.GIF"))); // NOI18N btnPrevious.setToolTipText(getBundleString("previous.page")); btnPrevious.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnPrevious.setMaximumSize(new java.awt.Dimension(23, 23)); btnPrevious.setMinimumSize(new java.awt.Dimension(23, 23)); btnPrevious.setPreferredSize(new java.awt.Dimension(23, 23)); btnPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPreviousActionPerformed(evt); } }); btnPrevious.addKeyListener(keyNavigationListener); tlbToolBar.add(btnPrevious); btnNext.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/next.GIF"))); // NOI18N btnNext.setToolTipText(getBundleString("next.page")); btnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnNext.setMaximumSize(new java.awt.Dimension(23, 23)); btnNext.setMinimumSize(new java.awt.Dimension(23, 23)); btnNext.setPreferredSize(new java.awt.Dimension(23, 23)); btnNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNextActionPerformed(evt); } }); btnNext.addKeyListener(keyNavigationListener); tlbToolBar.add(btnNext); btnLast.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/last.GIF"))); // NOI18N btnLast.setToolTipText(getBundleString("last.page")); btnLast.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnLast.setMaximumSize(new java.awt.Dimension(23, 23)); btnLast.setMinimumSize(new java.awt.Dimension(23, 23)); btnLast.setPreferredSize(new java.awt.Dimension(23, 23)); btnLast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLastActionPerformed(evt); } }); btnLast.addKeyListener(keyNavigationListener); tlbToolBar.add(btnLast); txtGoTo.setToolTipText(getBundleString("go.to.page")); txtGoTo.setMaximumSize(new java.awt.Dimension(40, 23)); txtGoTo.setMinimumSize(new java.awt.Dimension(40, 23)); txtGoTo.setPreferredSize(new java.awt.Dimension(40, 23)); txtGoTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtGoToActionPerformed(evt); } }); txtGoTo.addKeyListener(keyNavigationListener); tlbToolBar.add(txtGoTo); pnlSep02.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep02); btnActualSize.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/actualsize.GIF"))); // NOI18N btnActualSize.setToolTipText(getBundleString("actual.size")); btnActualSize.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnActualSize.setMaximumSize(new java.awt.Dimension(23, 23)); btnActualSize.setMinimumSize(new java.awt.Dimension(23, 23)); btnActualSize.setPreferredSize(new java.awt.Dimension(23, 23)); btnActualSize.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnActualSizeActionPerformed(evt); } }); btnActualSize.addKeyListener(keyNavigationListener); tlbToolBar.add(btnActualSize); btnFitPage.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/fitpage.GIF"))); // NOI18N btnFitPage.setToolTipText(getBundleString("fit.page")); btnFitPage.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitPage.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitPage.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitPage.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitPage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitPageActionPerformed(evt); } }); btnFitPage.addKeyListener(keyNavigationListener); tlbToolBar.add(btnFitPage); btnFitWidth.setIcon(new javax.swing.ImageIcon( getClass().getResource("/net/sf/jasperreports/view/images/fitwidth.GIF"))); // NOI18N btnFitWidth.setToolTipText(getBundleString("fit.width")); btnFitWidth.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnFitWidth.setMaximumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setMinimumSize(new java.awt.Dimension(23, 23)); btnFitWidth.setPreferredSize(new java.awt.Dimension(23, 23)); btnFitWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFitWidthActionPerformed(evt); } }); btnFitWidth.addKeyListener(keyNavigationListener); tlbToolBar.add(btnFitWidth); pnlSep03.setMaximumSize(new java.awt.Dimension(10, 10)); tlbToolBar.add(pnlSep03); btnZoomIn.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomin.GIF"))); // NOI18N btnZoomIn.setToolTipText(getBundleString("zoom.in")); btnZoomIn.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomIn.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomIn.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); btnZoomIn.addKeyListener(keyNavigationListener); tlbToolBar.add(btnZoomIn); btnZoomOut.setIcon( new javax.swing.ImageIcon(getClass().getResource("/net/sf/jasperreports/view/images/zoomout.GIF"))); // NOI18N btnZoomOut.setToolTipText(getBundleString("zoom.out")); btnZoomOut.setMargin(new java.awt.Insets(2, 2, 2, 2)); btnZoomOut.setMaximumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setMinimumSize(new java.awt.Dimension(23, 23)); btnZoomOut.setPreferredSize(new java.awt.Dimension(23, 23)); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); btnZoomOut.addKeyListener(keyNavigationListener); tlbToolBar.add(btnZoomOut); cmbZoom.setEditable(true); cmbZoom.setToolTipText(getBundleString("zoom.ratio")); cmbZoom.setMaximumSize(new java.awt.Dimension(80, 23)); cmbZoom.setMinimumSize(new java.awt.Dimension(80, 23)); cmbZoom.setPreferredSize(new java.awt.Dimension(80, 23)); cmbZoom.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmbZoomActionPerformed(evt); } }); cmbZoom.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cmbZoomItemStateChanged(evt); } }); cmbZoom.addKeyListener(keyNavigationListener); tlbToolBar.add(cmbZoom); add(tlbToolBar, java.awt.BorderLayout.NORTH); pnlMain.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { pnlMainComponentResized(evt); } }); pnlMain.setLayout(new java.awt.BorderLayout()); pnlTabs.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { pnlTabsStateChanged(evt); } }); pnlMain.add(pnlTabs, java.awt.BorderLayout.CENTER); scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); pnlInScroll.setLayout(new java.awt.GridBagLayout()); pnlPage.setMinimumSize(new java.awt.Dimension(100, 100)); pnlPage.setPreferredSize(new java.awt.Dimension(100, 100)); pnlPage.setLayout(new java.awt.BorderLayout()); jPanel4.setMinimumSize(new java.awt.Dimension(100, 120)); jPanel4.setPreferredSize(new java.awt.Dimension(100, 120)); jPanel4.setLayout(new java.awt.GridBagLayout()); pnlLinks.setMinimumSize(new java.awt.Dimension(5, 5)); pnlLinks.setOpaque(false); pnlLinks.setPreferredSize(new java.awt.Dimension(5, 5)); pnlLinks.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnlLinksMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { pnlLinksMouseReleased(evt); } }); pnlLinks.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnlLinksMouseDragged(evt); } }); pnlLinks.setLayout(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; jPanel4.add(pnlLinks, gridBagConstraints); jPanel5.setBackground(java.awt.Color.gray); jPanel5.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel5.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; jPanel4.add(jPanel5, gridBagConstraints); jPanel6.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel6.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; jPanel4.add(jPanel6, gridBagConstraints); jPanel7.setBackground(java.awt.Color.gray); jPanel7.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel7.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; jPanel4.add(jPanel7, gridBagConstraints); jPanel8.setBackground(java.awt.Color.gray); jPanel8.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel8.setPreferredSize(new java.awt.Dimension(5, 5)); jLabel1.setText("jLabel1"); jPanel8.add(jLabel1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; jPanel4.add(jPanel8, gridBagConstraints); jPanel9.setMinimumSize(new java.awt.Dimension(5, 5)); jPanel9.setPreferredSize(new java.awt.Dimension(5, 5)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; jPanel4.add(jPanel9, gridBagConstraints); lblPage.setBackground(java.awt.Color.white); lblPage.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblPage.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel4.add(lblPage, gridBagConstraints); pnlPage.add(jPanel4, java.awt.BorderLayout.CENTER); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); pnlInScroll.add(pnlPage, gridBagConstraints); scrollPane.setViewportView(pnlInScroll); pnlMain.add(scrollPane, java.awt.BorderLayout.CENTER); add(pnlMain, java.awt.BorderLayout.CENTER); pnlStatus.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0)); lblStatus.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N lblStatus.setText("Page i of n"); pnlStatus.add(lblStatus); add(pnlStatus, java.awt.BorderLayout.SOUTH); addKeyListener(keyNavigationListener); }