Microsoft Visual J++. Java


TextOut - 4


{

//

int yStart = 20;

 

//

int yCurrent = 20;

 

//

Dimension dimAppWndDimension = size();

//

g.setColor(Color.yellow);

//

g.fillRect(0, 0,

dimAppWndDimension.width - 1,

dimAppWndDimension.height - 1);

 

//

g.setColor(Color.black);

 

//

g.drawRect(0, 0,

dimAppWndDimension.width - 1,

dimAppWndDimension.height - 1);

 

//

//

if(m_Type1.equals("Bold"))

g.setFont(new Font(m_Font1, Font.BOLD, 25));

 

else if(m_Type1.equals("Italic"))

g.setFont(new Font(m_Font1, Font.ITALIC, 25));

 

else if(m_Type1.equals("Plain"))

g.setFont(new Font(m_Font1, Font.PLAIN, 25));

 

//

yCurrent += yStart;

 

//

g.drawString(m_Str1, 10, yCurrent);

 

//

FontMetrics fm = g.getFontMetrics();

 

//

//

yCurrent += fm.getHeight();

 

//

if(m_Type1.equals("Bold"))

g.setFont(new Font(m_Font2, Font.BOLD, 25));

 

else if(m_Type1.equals("Italic"))

g.setFont(new Font(m_Font2, Font.ITALIC, 25));

 

else if(m_Type1.equals("Plain"))

g.setFont(new Font(m_Font2, Font.PLAIN, 25));

 

//

g.drawString(m_Str2, 10, yCurrent);

 

//

//