Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,898 members, 7,828,164 topics. Date: Wednesday, 15 May 2024 at 04:09 AM

Any JDBC Guru In The House?? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Any JDBC Guru In The House?? (976 Views)

Can I Be A Guru In Go Progamming Without Knowledge In C++ Or Python / I'm A Guru In Visual Basic / Any Visual Basic (VB) Guru In The House? (2) (3) (4)

(1) (Reply) (Go Down)

Any JDBC Guru In The House?? by saemmanuel(m): 5:00pm On Nov 03, 2012
Java programmer who hav core knowledge of JDBC and work with IDE especially Netbean should please contact me on saemmanuel@ovi.com......Note i am also a programmer too, just need help on a project im working on...tanks
Re: Any JDBC Guru In The House?? by Kennyinusa(m): 3:18pm On Nov 05, 2012
What do you need help with undecided?
Re: Any JDBC Guru In The House?? by saemmanuel(m): 1:07am On Nov 09, 2012
Button code for printing Jframe using netbean
Re: Any JDBC Guru In The House?? by olyjosh(m): 1:37pm On Nov 09, 2012
Study your graphic api very well

remember its an event handling process too.

Try and run this, study it to know how to manipulate it. It even good that you are using IDE

[b]

import java.awt.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.print.*;
import java.util.*;
import javax.print.*;
import javax.print.attribute.*;
import javax.swing.*;

/**
This program demonstrates how to print 2D graphics
*/
public class PrintTest
{
public static void main(String[] args)
{
JFrame frame = new PrintTestFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}

/**
This frame shows a panel with 2D graphics and buttons
to print the graphics and to set up the page format.
*/
class PrintTestFrame extends JFrame
{
public PrintTestFrame()
{
setTitle("PrintTest"wink;
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

canvas = new PrintPanel();
add(canvas, BorderLayout.CENTER);

attributes = new HashPrintRequestAttributeSet();

JPanel buttonPanel = new JPanel();
JButton printButton = new JButton("Print"wink;
buttonPanel.add(printButton);
printButton.addActionListener(new
ActionListener()
{
public void actionPerformed(ActionEvent event)
{
try
{
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(canvas);
if (job.printDialog(attributes))
job.print(attributes);
}
catch (PrinterException e)
{
JOptionPane.showMessageDialog(PrintTestFrame.this, e);
}
}
});

JButton pageSetupButton = new JButton("Page setup"wink;
buttonPanel.add(pageSetupButton);
pageSetupButton.addActionListener(new
ActionListener()
{
public void actionPerformed(ActionEvent event)
{
PrinterJob job = PrinterJob.getPrinterJob();
job.pageDialog(attributes);
}
});

add(buttonPanel, BorderLayout.NORTH);
}

private PrintPanel canvas;
private PrintRequestAttributeSet attributes;

private static final int DEFAULT_WIDTH = 300;
private static final int DEFAULT_HEIGHT = 300;
}

/**
This panel generates a 2D graphics image for screen display
and printing.
*/
class PrintPanel extends JPanel implements Printable
{
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
drawPage(g2);
}

public int print(Graphics g, PageFormat pf, int page)
throws PrinterException
{
if (page >= 1) return Printable.NO_SUCH_PAGE;
Graphics2D g2 = (Graphics2D) g;
g2.translate(pf.getImageableX(), pf.getImageableY());
g2.draw(new Rectangle2D.Double(0, 0, pf.getImageableWidth(), pf.getImageableHeight()));

drawPage(g2);
return Printable.PAGE_EXISTS;
}

/**
This method draws the page both on the screen and the
printer graphics context.
@param g2 the graphics context
*/
public void drawPage(Graphics2D g2)
{
FontRenderContext context = g2.getFontRenderContext();
Font f = new Font("Serif", Font.PLAIN, 72);
GeneralPath clipShape = new GeneralPath();
TextLayout layout = new TextLayout("Its olyjosh", f, context);
AffineTransform transform = AffineTransform.getTranslateInstance(0, 72);
Shape outline = layout.getOutline(transform);
clipShape.append(outline, false);

g2.draw(clipShape);
g2.clip(clipShape);

final int NLINES =50;
Point2D p = new Point2D.Double(0, 0);
for (int i = 0; i < NLINES; i++)
{
double x = (2 * getWidth() * i) / NLINES;
double y = (2 * getHeight() * (NLINES - 1 - i))
/ NLINES;
Point2D q = new Point2D.Double(x, y);
g2.draw(new Line2D.Double(p, q));
}
}
}


[/b]


No tell any body say I still am for you ni...lol
Re: Any JDBC Guru In The House?? by olyjosh(m): 1:43pm On Nov 09, 2012
No mind this forum for you. Those places wey u see wink na just closing bracket ) dey
Re: Any JDBC Guru In The House?? by olyjosh(m): 1:47pm On Nov 09, 2012
saemmanuel: Button code for printing Jframe using netbean

Which one come be JDBC(Java Database Connectivity) guru own for printing jFrame

(1) (Reply)

Have You Observed The New Feature of Nairaland? / Eclipse... / Please Help On Userinterface And Userexperience

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.