Click here to Skip to main content
15,912,507 members
Home / Discussions / Java
   

Java

 
AnswerRe: java string Pin
jschell7-Dec-13 10:49
jschell7-Dec-13 10:49 
AnswerRe: java string Pin
Peter_in_27807-Dec-13 22:44
professionalPeter_in_27807-Dec-13 22:44 
Questioncode to develop main window in auto mobile spare parts Pin
Member 104492436-Dec-13 0:49
Member 104492436-Dec-13 0:49 
AnswerRe: code to develop main window in auto mobile spare parts Pin
Richard MacCutchan6-Dec-13 2:12
mveRichard MacCutchan6-Dec-13 2:12 
AnswerRe: code to develop main window in auto mobile spare parts Pin
jschell6-Dec-13 12:14
jschell6-Dec-13 12:14 
Generalcareer after bcs Pin
Member 104492436-Dec-13 0:48
Member 104492436-Dec-13 0:48 
GeneralRe: career after bcs Pin
Richard MacCutchan6-Dec-13 2:11
mveRichard MacCutchan6-Dec-13 2:11 
QuestionJFrame showing nothing. Pin
chdboy4-Dec-13 23:24
chdboy4-Dec-13 23:24 
I'm not able to see content on JFrame ,when JFrame shows up.

Java
import java.awt.*;

import javax.swing.*;
import java.awt.event.*;
public class GraphicUse extends JPanel
{
public void PaintComponent(Graphics gr)
{	
	super.paintComponents(gr);
	this.setBackground(Color.BLUE);
	gr.setColor(Color.WHITE);
	gr.fillRect(50, 50, 100, 100);
	gr.setColor(new Color(139,38,190));
	gr.fillRect(50, 70, 100, 100);
	gr.setColor(Color.RED);
	gr.drawString("This is a new String", 50, 90);	
}
	
	public static void main(String[] args) 
	{
	}

}


And displaying it in another class which extends Frame

Java
JFrame newframe = new JFrame("Color Frame");
	         newframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         
	         GraphicUse gu = new GraphicUse();	         
	         newframe.add(gu);
	         newframe.setSize(250,300);
	         newframe.setVisible(true);

QuestionRe: JFrame showing nothing. Pin
Richard MacCutchan4-Dec-13 23:42
mveRichard MacCutchan4-Dec-13 23:42 
AnswerRe: JFrame showing nothing. Pin
chdboy5-Dec-13 0:06
chdboy5-Dec-13 0:06 
GeneralRe: JFrame showing nothing. Pin
Richard MacCutchan5-Dec-13 0:47
mveRichard MacCutchan5-Dec-13 0:47 
GeneralRe: JFrame showing nothing. Pin
chdboy5-Dec-13 0:53
chdboy5-Dec-13 0:53 
GeneralRe: JFrame showing nothing. Pin
Richard MacCutchan5-Dec-13 0:56
mveRichard MacCutchan5-Dec-13 0:56 
AnswerRe: JFrame showing nothing. Pin
suvi from mumbai10-Dec-13 1:18
suvi from mumbai10-Dec-13 1:18 
QuestionVariable not updated Pin
Kujtim Hyseni3-Dec-13 8:19
Kujtim Hyseni3-Dec-13 8:19 
QuestionRe: Variable not updated Pin
Richard MacCutchan3-Dec-13 8:49
mveRichard MacCutchan3-Dec-13 8:49 
AnswerRe: Variable not updated Pin
Kujtim Hyseni3-Dec-13 8:59
Kujtim Hyseni3-Dec-13 8:59 
GeneralRe: Variable not updated Pin
Richard MacCutchan3-Dec-13 9:18
mveRichard MacCutchan3-Dec-13 9:18 
GeneralRe: Variable not updated Pin
Kujtim Hyseni3-Dec-13 9:20
Kujtim Hyseni3-Dec-13 9:20 
QuestionRe: Variable not updated Pin
Richard MacCutchan3-Dec-13 9:43
mveRichard MacCutchan3-Dec-13 9:43 
AnswerRe: Variable not updated Pin
Kujtim Hyseni3-Dec-13 9:48
Kujtim Hyseni3-Dec-13 9:48 
GeneralRe: Variable not updated Pin
Richard MacCutchan3-Dec-13 10:35
mveRichard MacCutchan3-Dec-13 10:35 
QuestionBezier Curve using java Graphics2D Pin
f262-Dec-13 21:27
f262-Dec-13 21:27 
AnswerRe: Bezier Curve using java Graphics2D Pin
Richard MacCutchan3-Dec-13 2:35
mveRichard MacCutchan3-Dec-13 2:35 
QuestionRe: Bezier Curve using java Graphics2D Pin
f263-Dec-13 19:55
f263-Dec-13 19:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.