void viewAllItem(){
clrscr();
menu1st();
cout<<endl;
cout<<endl;
cout<<setw(28)<<" ITEM NO"<<setw(18)<<" ITEM NAME"<<setw(18)<<"PRICE"<<endl;
for(int x=0;x<index;x++){
itm = itmArr[x];
cout<<endl;
cout<<setw(25)<<itm.IT;
cout<<setw(18)<<itm.name;
cout<<setw(19)<<itm.price<<endl;
}
}

hamoma karanawa wage database systems hadanne natuwa alut deyak karana eka maxxa.
make a software which connects to internet and do something..you can easily surf internet using java!
mama software ekak kala tv freak kiyala hope you know about that!(I posted a thread also)
its a software about searching streaming links fot tv epsiodes you wanna watch!
it realy made a differnt in internet society. coz its the only software that does it.. so think something new.. take ur time... minissu online gihilla karana wadak software ekakin karanna puluwan unama eka nikanma hit wenawa..i knw coz i still get huge number of downloads per day!
machn i love java hope u do 2.. so ona help ekak dennam..
podi idea ekak ganna meka bala balapan
mage wadak
http://www.gettvfreak.com/p/download-tv-freak.html

wwooww maru ne
i feel i like need to do something new mama matalam internet eka sambandawa monawa hari karanna i love learn new things thanks friend![]()
malli serial port eken oyata ona deyak karanna puluwan!
printer ekata set wenne parallel cable eka..so you can program it easily.
but do u knw wat are tha data bits and status bits(status registry) and ack bits of tha parallel port??
ewa tika dannattam oka liyanna tikak amarui
if u knw them
try this in visual CMD
void _stdcall Out32(short PortAddress,short data);
void main(){
for(; ; ){
Out32(0x378,0xff)
}
}
meka terenawada kiyala kiyanna..otherwise you stil got lot to learn malla
if u get this i can help u to create tha java code
malli serial port eken oyata ona deyak karanna puluwan!
printer ekata set wenne parallel cable eka..so you can program it easily.
but do u knw wat are tha data bits and status bits(status registry) and ack bits of tha parallel port??
ewa tika dannattam oka liyanna tikak amarui
if u knw them
try this in visual CMD
void _stdcall Out32(short PortAddress,short data);
void main(){
for(; ; ){
Out32(0x378,0xff)
}
}
meka terenawada kiyala kiyanna..otherwise you stil got lot to learn malla
if u get this i can help u to create tha java code
meken wenne "This method call by itself"....ewa mata therenawa ayya.....
data bits ,status bits(status registry) ,ack bits gananam mama echchara danne na ayya...
Mata one report(jasper) ekak, view wenne nathuwa..print dialog eka open wenne nathuwa..kelinma print button eka press kalama print kara ganna..
Mekata kiyanne direct print kiyalada koheda.......
mata cord ekak hambuna...eka wada karanne na.......that is below..
public class cls_Report_passBook {
String reportDir = "D:\\easyBanker\\src\\Report\\";
public void generateReport(String reportname, Map params) throws JRException{
String printer="CutePDF Writer";
PrintService service = null;
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(MediaSizeName.ISO_A4);
PrintService[] services3 = PrintServiceLookup.lookupPrintServices(null, null);
for(int k=0;k<services3.length;k++){
if(services3[k].getName().trim().equals(printer.trim())){
service = services3[k];
}
}
if(service == null){
System.out.println("PRINTER NOT FOUND->"+printer);
}else {
JasperReport jr = JasperCompileManager.compileReport(reportDir + reportname);
JasperPrint jp = JasperFillManager.fillReport(jr, params, new cls_Connect().connect());
// JasperViewer.viewReport(jp, false);
JRExporter exporter = new JRPrintServiceExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, service.getAttributes());
exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, service.getAttributes());
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE);
exporter.exportReport();
}
}
}
if you can put some cording regarding my problem..please..
Malla i can give u coding a print a text file using java. when you click tha button, yur doc will be printed!
but malla for direct printing you need to know the bit patterns.
search google for tht.
import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.print.*;
import java.text.*;
/**
* The PrintText application expands on the
* PrintExample application in that it images
* text on to the single page printed.
*/
public class JavaApplication12 implements Printable {
/**
* The text to be printed.
*/
private static final String mText ="YOUR DATA HERE";
/**
* Our text in a form for which we can obtain a
* AttributedCharacterIterator.
*/
private static final AttributedString mStyledText = new AttributedString(mText);
/**
* Print a single page containing some sample text.
*/
static public void main(String args[]) {
/* Get the representation of the current printer and
* the current print job.
*/
PrinterJob printerJob = PrinterJob.getPrinterJob();
/* Build a book containing pairs of page painters (Printables)
* and PageFormats. This example has a single page containing
* text.
*/
Book book = new Book();
book.append(new JavaApplication12(), new PageFormat());
/* Set the object to be printed (the Book) into the PrinterJob.
* Doing this before bringing up the print dialog allows the
* print dialog to correctly display the page range to be printed
* and to dissallow any print settings not appropriate for the
* pages to be printed.
*/
printerJob.setPageable(book);
/* Show the print dialog to the user. This is an optional step
* and need not be done if the application wants to perform
* 'quiet' printing. If the user cancels the print dialog then false
* is returned. If true is returned we go ahead and print.
*/
boolean doPrint = printerJob.printDialog();
if (doPrint) {
try {
printerJob.print();
} catch (PrinterException exception) {
System.err.println("Printing error: " + exception);
}
}
}
/**
* Print a page of text.
*/
public int print(Graphics g, PageFormat format, int pageIndex) {
/* We'll assume that Jav2D is available.
*/
Graphics2D g2d = (Graphics2D) g;
/* Move the origin from the corner of the Paper to the corner
* of the imageable area.
*/
g2d.translate(format.getImageableX(), format.getImageableY());
/* Set the text color.
*/
g2d.setPaint(Color.black);
/* Use a LineBreakMeasurer instance to break our text into
* lines that fit the imageable area of the page.
*/
Point2D.Float pen = new Point2D.Float();
AttributedCharacterIterator charIterator = mStyledText.getIterator();
LineBreakMeasurer measurer = new LineBreakMeasurer(charIterator, g2d.getFontRenderContext());
float wrappingWidth = (float) format.getImageableWidth();
while (measurer.getPosition() < charIterator.getEndIndex()) {
TextLayout layout = measurer.nextLayout(wrappingWidth);
pen.y += layout.getAscent();
float dx = layout.isLeftToRight()? 0 : (wrappingWidth - layout.getAdvance());
layout.draw(g2d, pen.x + dx, pen.y);
pen.y += layout.getDescent() + layout.getLeading();
}
return Printable.PAGE_EXISTS;
}
}
if you dont get the methods follow this steps.
http://download.oracle.com/javase/tutorial/2d/printing/set.html
oracle is a graet way to learn java!
Thanks ayya you are great....jaya wewa
this not complex at all machan
heres the codin,
(im doing with t with a button, and button is on ma jframe)
this is tha main class(compile this)
//------------------------------------------------------------------------
public class JavaApplication12 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
NewJFrame nw=new NewJFrame();
nw.setVisible(true);
// TODO code application logic here
}
}
//--------------------------------------------------------------------
Now i have implemented 2 buttons in ma jframe
one button is used to hide the jtextfield and from other button you can view it
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame.jTextField1.setVisible(false);
// TODO add your handling code here:
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try{
jTextField1.setVisible(true);
}
catch (Exception e){
}
// TODO add your handling code here:
}
this is tha basic idea of your software. Now you can edit it lik this
add a panel to tha jframe and add jtextfield and button on to that
goto panels customized code(write click on t and select customize code)
and add jbutton 2s coding there
now when you compile your main program jframe comesup!
but not the textfield coz its visibility is off via tha panel.
so only when user clicks on the button its visibilty is on.
HOPE YOU GT THA IDEA!
IF U STILL CANT GET IT POST HERE ILL SEND YOU MA APPLICATION FOLDER



ayya......
http://java.sun.com/developer/Books/javaprogramming/cookbook/11.pdf
me PDF eke thiyenne paraller port programming gana neda?E coording hari ewada?
akila ayya......
Mama use karana sinhala unicode.....kaputa unicode,kandy unicode & malathi web. But ewage samahara characters upset...wena hoda sinhala unicode font ekak thiyenawada?
Ado Mehema newe ban....
uba karanne predefined butten eka hide karala show karana sellama...
uba kiyanne choo case ne...?
Have to add dynamically man....If user needs 20 button code should be automatically generated. No of buttons is unknown untile runtime.
Imagine that we have to create a realtime IDE....
puluwamnam help karapan.

Yap but oka tikak paranai but codes are correct(poddak eheta meheta wela ati)
Imn't familiar with anytin about sinhala unis. but try ths
http://www.siyabas.lk/sinhala_how_to_install.html
Use collections to hold the text fields or whatever filed you want hold.. but this may differ according to your needHave to implement a java app with ability to add new textbox, lables at runtime according to user interaction.
If u can post sample code.
Dont say question is not clear![]()
