jframe

search for more blogs here

 

"how to put picture or ascii art in jframe....." posted by ~Ray
Posted on 2008-11-13 12:19:42

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); }} You should never (well almost never) override the paint() method of a JFrame. You should override the paintComponent(Graphics g) method of another component (say a JPanel) and set the component as the 'content pane' of the JFrame thanks for the reply sabre150.. did you mean i must create a new object inside that frame (like JPanel) instead of painting the frame itself? but how if you want to put picture or even painting the object itself? but how if you want to put picture or even painting the object itself? I don't really understand. Do as you have in your current code but do it in the paintComponet method of a JPanel and set the JPanel as the 'content pane' of your JFrame. I don't know how else to say it! In the future. Swing related questions should be posted in the Swing forum. Read the Swing tutorial on "Custom Painting" for a step by step example:http://java sun com/docs/books/tutorial/uiswing/painting/index html

Forex Groups - Tips on Trading

Related article:
http://forum.java.sun.com/thread.jspa?threadID=5233111

comments | Add comment | Report as Spam


"Problem with Paining in a Panel in a JFrame." posted by ~Ray
Posted on 2008-03-12 23:10:53

So I can paint directly on a JFrame and I can create on a class that extends adorn and put the Panel on a JFrame. But if I try to Repaint the Panel it won't show on the JFrame. Do I have to do anything to the JFrame to show the changes to the objects inside as well? I'm not sure if you've done this but don't change the paint method when using Swing components use paintComponent instead. By default the JFrame will paint its children. Just remember whenever overriding any of the paintComponent methods to call super paintComponent(g) first. yert527 wrote:Never mind please excuse the idoit who forgot to add the action listener. That was going to be my next suggestion honest. :)

Forex Groups - Tips on Trading

Related article:
http://forum.java.sun.com/thread.jspa?threadID=5231289

comments | Add comment | Report as Spam


"Problem with Paining in a Panel in a JFrame." posted by ~Ray
Posted on 2008-03-12 23:10:53

So I can create directly on a JFrame and I can paint on a class that extends adorn and put the Panel on a JFrame. But if I try to paint the adorn it won't show on the JFrame. Do I have to do anything to the JFrame to show the changes to the objects inside as well? I'm not sure if you've done this but don't change the create method when using Swing components use paintComponent instead. By default the JFrame will paint its children. Just remember whenever overriding any of the paintComponent methods to call super paintComponent(g) first. yert527 wrote:Never mind please excuse the idoit who forgot to add the action listener. That was going to be my next suggestion honest. :)

Forex Groups - Tips on Trading

Related article:
http://forum.java.sun.com/thread.jspa?threadID=5231289

comments | Add comment | Report as Spam


"Communication Between JFrame Panels" posted by ~Ray
Posted on 2008-01-01 21:15:50

We've had some interesting contributions to the this past week. One of them comes from Joseph Cotton: . This Tips & Tricks entry shows you how to make communication possible between two JFrame panels. For example pushing the button on panel B and undergo a message placed in the text box in panel A. (and endorse versa). Be sure to analyse this out. I'm certain that you'll like what you see. When do we get to see YOUR contribution? Posted by branajam ( Oct 26 2007. 07:04:30 PM CEST ) I think a better way to do this would be to have a listener on A that can listen to events dispatched by B. That way if you undergo "two" B frames change state you are not stepping on your frame's references. Sending a message on the EDT in this case is probably not a big deal although using an EventBus -- see eventbus dev java net would be more effective. Posted by Jason Drake on October 27. 2007 at 10:01 AM CEST

Forex Groups - Tips on Trading

Related article:
http://blogs.sun.com/branajam/entry/communication_between_jframe_panels

comments | Add comment | Report as Spam


"jframe icon" posted by ~Ray
Posted on 2007-12-15 15:03:37

I am just starting to learm swing and I am trying to dress the JFrame icon. I undergo tried 2 methods:1 setIconImage(Toolkit getDefaultToolkit() getImage("star gif"));which works,2. ImageIcon logo = new ImageIcon("star gif");setFrameIcon(logo);which gives me a symbol not open compiler error. I have imported the displace classes can anybody express me what is do by with example 2. Regards Paul Unless otherwise licensed code in all technical manuals herein (including articles. FAQs samples) is provided under this.

Forex Groups - Tips on Trading

Related article:
http://forum.java.sun.com/thread.jspa?threadID=5228315

comments | Add comment | Report as Spam


"error "javax.swing.JFrame" cannot find symbol frame ..." posted by ~Ray
Posted on 2007-12-09 13:37:55

Getting above errror when running the code below how do I install the Jframe so the schedule can see it. Looks like JRE and JDK does not undergo it. import javax swing.*; import java awt.*; import java awt event.*;public class SimpleGui1{ public static void main(String []args){ JFrame close in = new JFrame(); JButton button = new JButton("click me"); frame setDefaultCloseOperation(JFrame. move_ON_CLOSE); frame getContentPane90 add(button); frame setSize(300,300); frame setVisible(true); } This is the error I'm getting:C:\Documents and Settings\mommy\My Documents\Java Projects\jframe\SimpleGui1 java:17: cannot sight symbolsymbol : variable getContentPane90location: categorise javax swing. JFrame frame getContentPane90 add(button); ^1 errorTool completed with exit label 1 You're welcome. In future though look where it's giving you an error and try actually looking at the lie that the error is occurring on. I think that should of been really easy to sight since it be'd you intended to write () in the first place but just didn't have your shift key pressed.

Forex Groups - Tips on Trading

Related article:
http://forum.java.sun.com/thread.jspa?threadID=5230596

comments | Add comment | Report as Spam


"error "javax.swing.JFrame" cannot find symbol frame ..." posted by ~Ray
Posted on 2007-12-09 13:37:55

Getting above errror when running the code below how do I lay the Jframe so the schedule can see it. Looks desire JRE and JDK does not have it. merchandise javax swing.*; import java awt.*; merchandise java awt event.*;public categorise SimpleGui1{ public static void main(String []args){ JFrame frame = new JFrame(); JButton button = new JButton("click me"); close in setDefaultCloseOperation(JFrame. move_ON_change state); frame getContentPane90 add(add); close in setSize(300,300); close in setVisible(adjust); } This is the error I'm getting:C:\Documents and Settings\mommy\My Documents\Java Projects\jframe\SimpleGui1 java:17: cannot find symbolsymbol : variable getContentPane90location: class javax swing. JFrame frame getContentPane90 add(button); ^1 errorTool completed with move code 1 You're accept. In future though be where it's giving you an error and try actually looking at the line that the error is occurring on. I think that should of been really easy to sight since it seem'd you intended to type () in the first place but just didn't have your shift key pressed.

Forex Groups - Tips on Trading

Related article:
http://forum.java.sun.com/thread.jspa?threadID=5230596

comments | Add comment | Report as Spam


 

 




blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




the jframe archives:

11 articles in 2006-01
22 articles in 2006-02
27 articles in 2006-03
36 articles in 2006-04
27 articles in 2006-05
26 articles in 2006-06
24 articles in 2006-07
18 articles in 2006-08
22 articles in 2006-09
30 articles in 2006-10
22 articles in 2006-11
22 articles in 2006-12
12 articles in 2007-01
12 articles in 2007-02
3 articles in 2007-03
7 articles in 2007-04
11 articles in 2007-05
10 articles in 2007-06
3 articles in 2007-07
1 articles in 2007-09




next page


jframe