|
||
|
|||
|
Hi, ive got a bit of a problem in that i am trying to make text appear in a Jpanel at an exact xy coordinate e.g 200,300 but have found that Jlabel only allows relative layouts e.g Center, south etc
Any Ideas how i could fix this problem cheers
|
|
||||
|
Re: HelloWorld's response, there are two caveats.
First and more important, the method to override for performing custom painting in a JComponent subclass is paintCOmponent(...), not paint(...). Second, the code shown iwll place the baseline of the String at 500 pixels from teh left and 200 pixels from the top of the JPanel, which may not fit the requirement. db |
|
||||
|
::blush::
My bad. While technically the default paint method is called to draw the component and all sub-components, it is not the recommended method that should be over-ridden for custom component painting (which is strange, because it is in applets even though they just have a JPanel. Stupid double standards).
__________________
ASCII a question .. Get an ANSI Please surround your code with [highlight=Java]code goes here[/highlight]. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| java program to copy a text file to onother text file | francoc | File I/O & Other I/O Streams | 3 | 23-04-2010 08:10 PM |
| Swing JTable sorting | chronoz13 | Algorithms & Recursion | 2 | 30-01-2010 12:51 PM |
| Swing Timers | Sterzerkmode | AWT / Java Swing | 5 | 11-11-2009 01:10 AM |
| java swing help | JM_4ever | AWT / Java Swing | 3 | 07-10-2009 11:42 AM |
| Help - Swing Timer, 2 KeyEvents | Gheta | AWT / Java Swing | 2 | 29-07-2009 07:46 PM |
|
100 most searched terms
Search Cloud
|
| 2 dimensional arraylist java 2d arraylist java actionlistener actionlistener in java addactionlistener addactionlistener java convert double to integer java double format java double to integer in java double to integer java drag en drop programmeren java eclipse shortcut keys exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double in java format double java get mouse position java java 2d arraylist java actionlistener java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java send keystrokes to another application java two dimensional arraylist java.io.ioexception: premature eof java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton action jbutton actionlistener jbutton java jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics smack api two dimensional arraylist two dimensional arraylist java unable to sendviapost to url what is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? |