Font Drawing: Rectangle - Online Code

Description

This code shows how to Draw Font inside a Rectangle.This code automatically calculates the no of characters present in Text and draws a Rectangle accordingly.

Source Code

import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class StringRectPaintPanel extends JPanel {
  public void paint(Graphics g) {
... (login or register to view full code)

To view full code, you must Login or Register, its FREE.

Hey, registering yourself just takes less than a minute and opens up a whole new GetGyan experience.




Comments

Ritesh kushwaha on 2009-04-05 00:51:31 wrote,

Nice code dear

Prateek Srivastava on 2009-04-05 19:16:05 wrote,

@Ritesh kushwaha,
Thnxx for d comment u can get more resources lyk dis on our site so i hope u will keep visiting...

Rajesh Kumar Gupta on 2009-04-05 19:22:29 wrote,

@Prateek Srivastava,
nice code yaar, really helpful in my project :-)