Ramkumar Vaitheki

Greenhorn
+ Follow
since Jan 03, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ramkumar Vaitheki

Dear all,

Can you please tell me links of SCWCD 1.4 and 1.5 on line mock exam?

Thanks,
Ram
Dear all,

Can you please let me know the differences among SCWCD 1.4 and 1.5?. Kindly let me know the additional subjects involved in 1.5. Looking towards responses.

Thanks,
Ram
By default in swing, all the components are containers. JFrame is a container as well as component. I should not use JInternalFramem,needed to use JFrame alone. It gives "Illegal argument exception" while trying it.

Ram
15 years ago
Dear all,

Is it possible to embed an JFrame into an another JFrame. If we can, tell me the way of adding it. Looking forward your response.

Thanks,
Ram
16 years ago
Thanks David, It would be helpful
16 years ago
Hi all,

Can you please let me know the way of creating immutable objects from our userdefined class? Looking forward responses

Thanks,
Ram
16 years ago
Hi all,

Could you please let me know the site names for writing SCJP exam. ?it would be helpful if your replies are at the earlier.
Thanks in advance!!

Thanks,
Ram
16 years ago
Hi all,

Kindly Suggest me the best book for swings.


Thanks,
Ram
16 years ago
Hi all,

Please let me know if anyone knows java development competition site. Eagerly looking forward your favourable response.


Thanks in advance,
Ram
16 years ago
Dear all,

Am using log4j logger for my application. To filter out the single lever, how to set log4j.properties file. Since i have different levels like info,debug,warning,error etc. I got to have a log file which has to display the levels which are mentioned in the properties file. if i set "info" it has to display only info log. if i set two levels it has to display two level logs. Finally if i set none it should not display anything. Hope you all got my requirement. Please help me out.


Thanks in advance,
Ram
import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
Hi all,

Please skim through this code,

import java.awt.print.*;
import java.text.*;

public class PrintText implements Printable {

private static final String mText ="Device Name: "+acmtxt_DeviceName.getText()+"\n Alarm Text :"++acmtxt_AlarmText.getText()+"\n Time stamp: "+acmtxt_TimeStamp.getText()+"\n Alarm Detail: "+jta_AlarmDetail.getText();

private static final AttributedString mStyledText = new AttributedString(mText);

static public void main(String args[]) {

PrinterJob printerJob = PrinterJob.getPrinterJob();

Book book = new Book();
book.append(new PrintText(), new PageFormat());

printerJob.setPageable(book);

boolean doPrint = printerJob.printDialog();
if (doPrint) {
try {
printerJob.print();
} catch (PrinterException exception) {
System.err.println("Printing error: " + exception);
}
}
}
public int print(Graphics g, PageFormat format, int pageIndex) {

Graphics2D g2d = (Graphics2D) g;

g2d.translate(format.getImageableX(), format.getImageableY());

g2d.setPaint(Color.black);

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;
}


Please skim through the above code. It does well of printing, the only issue was it does not print what i has inputted text. Rather than it prints sequentially. Anyone can help me out in this regard to print this as this form

Device Name: N/A
Alarm Text: New Device Found.
Time Stamp: 2007-09-01 19:57:56
Alarm Detail: New Device Found. IP Address: 135.111.122.56

Now it prints as Device Name: N/AAlarm Text: New Device Found.Time Stamp: 2007-09-01 19:57:56Alarm Detail: New Device Found. IP Address: 135.111.122.56

Any one please help me out, immediate reply it would be helpful..

Thanks in advance,
Ram
16 years ago
Hi Joanne,

As you print i would have print only 3 spaces it prints a lot spaces. Then i tried trim() but i could not. Anyhow thanks for the reply. Kindly do reply if you have answer.

Hi ranchers please help me out in the reagard

Thanks,
Ram
16 years ago
Thanks for the reply.. i tried all this way but could not.. Anyone pls try this out
16 years ago
Hi.. thanks for the reply..i know the configuration file format.. i have it in separate folder. It seems there is no provision for handilng avoid space through configuration file.

FYI, herewith i have provided the Syslog configuration XML which am using

<?xml version="1.0" encoding="UTF-8"?>
<Syslog defaultMask="INFO">
<Logger name="myPrinterLog" class="com.protomatter.syslog.FileLog">
<stream>System.err</stream>
<Format class="com.protomatter.syslog.SimpleSyslogTextFormatter">
<showChannel>false</showChannel>
<showThreadName>false</showThreadName>
<showHostName>false</showHostName>
</Format>
<Policy class="com.protomatter.syslog.SimpleLogPolicy">
<channels>ALL_CHANNEL</channels>
<logMask>INHERIT_MASK</logMask>
</Policy>
<fileName></fileName>
<append>true</append>
<autoFlush>true</autoFlush>
</Logger>
</Syslog>

Hi.. all Please help me out in this regard.

Thanks,
Ram
16 years ago
Hi all,

Please skip the previous mail.

Am having a doubt on Promatter Syslog. I have implemented a code on it. But the output was not desire. I would like to make the output for my desire. Actually the output is being like this.

I dont want the extra space to be displayed. I want to display the output to be like this.

It would be helpfut me in the earlier replies.

Thanks & Regards,
Ram

[ added code tags to preserve spacing - Jim ]
[ August 21, 2007: Message edited by: Jim Yingst ]
16 years ago