Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to put picture or ascii art in jframe.....

807603Nov 4 2007 — edited Nov 4 2007
hi guys....., am a newbie in java, i found difficulties when am trying to put picture or an ascii art in jframe, maybe u guys can give me some hints....(based on my code),here i submit a part of my code in jframe section:...

import java.awt.*;
import javax.swing.*;
import java.awt.Color;
import javax.swing.JOptionPane;
import java.util.Date;
class MyFrame extends JFrame
{
public void paint ( Graphics g )
{
this.setBackground(Color.BLACK);
g.setColor(Color.RED);
g.setFont(new Font("Serif", Font.BOLD, 18));
g.drawString("WELCOME", 200, 50);
g.setFont(new Font("Serif", Font.BOLD, 14));
g.drawString("\n", 10, 70 );
g.drawString("Date = " + new Date(), 10, 140);
}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2007
Added on Nov 4 2007
4 comments
670 views