Any java programers here?

Anything else. Post a funny site or tell us about yourself. Discuss current events or whatever else you want. Post off topic threads here.
Post Reply
User avatar
dark_killer
Regular Member
Posts: 227
Joined: Sun Feb 25, 2007 10:48 pm
Quick Reply: Yes
Location: aege

Any java programers here?

Post by dark_killer »

Well I need someone to help me with basic java. Just learning the ways of programing and my teacher wants to me to make a business card. The program that we use is java IDE. I would like to know what the code for changing the text font for a title. For the companies name I would like to inlarge the font, any know the code for that

Code: Select all

// The "BusinessCard" class.
import java.awt.*;
import hsa.Console;

public class BusinessCard
{
    static Console c;           // The output console
   
    public static void main (String[] args)
    {
        c = new Console ();
       String companyname, name, address,email,position,
         phone;
        int year;
       
c.println(" Type in the company's name, then press <enter>");
        companyname = c.readLine ();
        c.println(" Type in your full name , then press <enter>");
        name = c.readLine();
        c.println(" Type in your position is the company, then press <enter>");
        position = c.readLine();
        c.println(" Type in your adress, then press <enter>");
        address = c.readLine();
        c.println (" Type in the companies phone number, then press <enter>");
        phone = c.readLine();
        c.println(" Type in your e-mail address, then press <enter>");
        email = c.readLine();
        c.println(" Type in the years of service your company has been running for, then press <enter>");
        year = c.readInt();
        c.clear();
        c.println();
        c.println();
        c.println();
        c.println();
        c.println();
        c.println();



c.println("\t\t\t\t" + companyname);
this part, i would like to inlarge the it.

Code: Select all

c.println();
        c.println("\t\t\tName: " + name);
        c.println("\t\t\tPosition: " + position);
        c.println ("\t\t\tAdress: " + address);
        c.println("\t\t\thone: " + phone);
        c.println("\t\t\tE-mail address: " + email);
        c.println("\t\t\tYears of service: " +year);
       
        c.drawRect (120, 100, 400, 200);
        c.setColor (Color.red);
        c.fillRect (120,95,20,220);
        c.fillRect (125,95,410,20);
        c.fillRect (521,95,20,220);
        c.fillRect (120,301,430,20);
        c.setColor (Color.blue);
        c.fillRect (100,80,20,240);
        c.fillRect (100,80,460,20);
        c.fillRect (540,95,20,245);
        c.fillRect (100,320,460,20);
        c.setColor (Color.green);
        c.fillRect (80,65,20,290);
        c.fillRect (80,60,490,20);
        c.fillRect (560,60,20,290);
        c.fillRect (80,340,500,20);
        // Place your program here.  'c' is the output console
    } // main method
} // BusinessCard class
c.println(" Type in the company's name, then press <enter>");
        companyname = c.readLine ();
        c.println(" Type in your full name , then press <enter>");
        name = c.readLine();
        c.println(" Type in your position is the company, then press <enter>");
        position = c.readLine();
        c.println(" Type in your adress, then press <enter>");
        address = c.readLine();
        c.println (" Type in the companies phone number, then press <enter>");
        phone = c.readLine();
        c.println(" Type in your e-mail address, then press <enter>");
        email = c.readLine();
        c.println(" Type in the years of service your company has been running for, then press <enter>");
        year = c.readInt();
        c.clear();
        c.println();
        c.println();
        c.println();
        c.println();
        c.println();
        c.println();
       
       
        c.println("\t\t\t\t" + companyname);
        c.println();
        c.println("\t\t\tName: " + name);
        c.println("\t\t\tPosition: " + position);
        c.println ("\t\t\tAdress: " + address);
        c.println("\t\t\thone: " + phone);
        c.println("\t\t\tE-mail address: " + email);
        c.println("\t\t\tYears of service: " +year);
       
        c.drawRect (120, 100, 400, 200);
        c.setColor (Color.red);
        c.fillRect (120,95,20,220);
        c.fillRect (125,95,410,20);
        c.fillRect (521,95,20,220);
        c.fillRect (120,301,430,20);
        c.setColor (Color.blue);
        c.fillRect (100,80,20,240);
        c.fillRect (100,80,460,20);
        c.fillRect (540,95,20,245);
        c.fillRect (100,320,460,20);
        c.setColor (Color.green);
        c.fillRect (80,65,20,290);
        c.fillRect (80,60,490,20);
        c.fillRect (560,60,20,290);
        c.fillRect (80,340,500,20);
Image

Post Reply

Return to “Off Topic Lounge”