- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
6 Posted Topics
Hi all, I have a serious problem, I made a program in java that prints reports, I made and tested the reports with one printer, but when I used the program in another printer (and another pc) all the fields are printed around 5mm down of the normal position. I … | |
Hi, I'm using JasperReports in netbeans, on Ubuntu. When I execute my java application on netbeans I have no problem saving the reports, but when I clean and build the program, and run it from the .jar, the program can't save the reports. I don't know if that's because of … | |
Re: I use this method: [CODE] public String [] readFile(String filePath){ String [] lines=new String[1000];//Enough lines. int counter=0; try{ File file = new File(filePath);//The path of the File FileReader fileReader1 = new FileReader(file); BufferedReader buffer = new BufferedReader(fileReader1); boolean flag=true; while(true){ try{ lines[counter]=buffer.readLine();//Store a line in the array. if(lines[counter]==null){//If there isn't … | |
Re: I just show a JTable this way: Instantiate the table on constructor I guess: [CODE] ResultSet resultSet=new ResultSet(doQueryMethod("SELECT id,name,description FROM book")); DefaultTableModel mdlTable=new DefaultTableModel(); JTable table=new JTable(mdlTable); fillData(); [/CODE] Fill the table with resultSet data: [CODE] public void fillData(){ mdlTable.setColumnIdentifiers("ID","NAME","DESCRIPTION"); Object[] row; while(resultSet.next()){ row=new Object[]{ resultSet.getInt("id"), resultSet.getString("name"), resultSet.getString("description") }; mdlTable.addRow(row); … | |
Hi, I'm trying to set custom fonts, I can do it without problem with this code: [CODE] InputStream is = this.getClass().getResourceAsStream("/src/someFontName.ttf"); Font f=null; try { f = Font.createFont(Font.TRUETYPE_FONT,is).deriveFont(15f); } catch (FontFormatException ex) { Logger.getLogger(PanelLiquidacion.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(PanelLiquidacion.class.getName()).log(Level.SEVERE, null, ex); } txtPlace=new JTextField();txtPlace.setBounds(185,10,310,20); if(f!=null){ txtPlace.setFont(f); lblPlace.setFont(f); … | |
Re: Thanks, this was exactly what I was looking for |
The End.