Position on component in the screen

Hi!
I want to get position a text field on screen. I use method getBounds(), but this method get position on text field concerning on it parent. But I want to get positon concerning on screen.What can I do?
Thank you.

SwingUtilities.convertPointToScreen( new Point(0,0), textField )
* Convert a point from a component's coordinate system to
* screen coordinates.
* @param p a Point object (converted to the new coordinate system)
* @param c a Component object
public static void convertPointToScreen(Point p,Component c)

Similar Messages

  • How do you position a window on the screen?

    When I run a application how do I make the window open in the middle of the screen instead of the top left?

    Ah, a JFrame, then try this;-
       Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
       Dimension frameSize = frame.getSize();
          if (frameSize.height > screenSize.height) {
             frameSize.height = screenSize.height;
          if (frameSize.width > screenSize.width) {
             frameSize.width = screenSize.width;
      frame.setLocation((screenSize.width - frameSize.width)/2,(screenSize.height - frameSize.height)/2);
      frame.setVisible(true);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Moving layers leaves the old position lines ghosted on the screen!

    Hello guys,
    I don't know if this is an easy fix or not but this issue has randomly shown it's ugly head and is very irritating!
    When I move layers now from position A to position B, the old lines are still shown on screen in position A. Shown in this picture: http://i.imgur.com/6B1mcZq.jpg
    Any help on how to remove this issue would be greatly appreciated!

    Hi nskmartinez,
    For me it sounds like a hardware malfunction Either these lines are caused by internal monitor or graphic card itself. Easiest way to check this is connecting an external monitor. If the same happens on external monitor its graphic card problem and the mainboard needs replacing.
    If you need spare parts you can contact an authorized service provider in your country. The guys are able to order all Toshiba parts. Furthermore they can help you to replace the parts if you are not familiar with notebook disassembling.
    Sorry for this more or less standard answer but here its user to user forum only and if its really a hardware malfunction you need professional help to get spare parts and replace them. Furthermore you have already tried the recovery disk that should always and work and if not => Hardware problem.

  • How do I bypass trust computer if the screen doesn't work

    Hi,
    I have an iphone 5 that has a damaged screen. The phone was water damaged which has affected the screen. The screen turns on and shows the time as it usually would, but the 'touch' component of the screen has been damaged so I can't unlock the phone. The phone still turns on and works. I can receive calls if I have the headset plugged in and play music. I can also use Siri to make calls. . When plugged in to a computer the phone is registered but I need to trust the computer on the phone which I can't do. Is there any way I can bypass the 'trust computer ' while the phone is plugged into a computer so I can access the hard drive on the phone so I can copy all of the photo's?
    Any help would be appreciated.

    Get the screen replaced.
    Also, it's always a really bad idea not to activate iCloud and Find My iPhone.

  • How to get absolute screen position for component in borderlayout?

    I am trying to get the screen location for a point in a component in a panel. The panel has a borderlayout(). The component is currently in the CENTER position of the layout. When I use the getBounds() method for this component I can get the <x,y> coordinates relative to the client area of the panel. But that does not include the frame. I
    Does anyone know how I can do this?

    There is a convertPointToScreen method in SwingUtilities:
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/SwingUtilities.html

  • Component visibility in the screen,

    Hi
    I'm facing a problem in the visibility of the component.
    My need is to identify the component is in visibility or not.
    ex: In a panel, i'm trying to change the location of the label , at a stage the label gets moved to end and the label is not in the screen in display.
    How could i know the label is currently showing in view or not..
    is there method to identify the label in view or not ??
    regards
    rathinam.

    Hi thanks for your reply.
    here i pasted the sample program.
    let me know the solutions.
    For your information, i'm creating a stock ticker component.
    package table;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.util.List;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    public class TickerTesting extends JFrame {
    JFrame fTickerFrame;
    JPanel fTtickerpanel;
    List fArray;
    public TickerTesting() {
    fTickerFrame = new JFrame( "Ticker" );
    fTickerFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    fTickerFrame.setSize( new Dimension( 120, 40 ) );
    JPanel panel = new JPanel();
    panel.add( new Ticker( ) );
    fTickerFrame.getContentPane().add( panel, BorderLayout.CENTER );
    fTickerFrame.pack();
    fTickerFrame.setVisible( true );
    private class Ticker extends JPanel { // private JPanel panel;
    private boolean paused;
    public Ticker() {
    MouseListener listener = new MouseAdapter() {
    public void mouseEntered(MouseEvent event) {
    paused = true;
    public void mouseExited(MouseEvent event) {
    paused = false;
    addMouseListener( listener );
    fTtickerpanel = new JPanel();
    fTtickerpanel.addMouseListener( listener );
    fTtickerpanel.setPreferredSize(new Dimension(500,50));
    final TickerLabel label1 = new TickerLabel();
    label1.setText("1     2     3     4     5     6     7     8     9");
    fTtickerpanel.add( label1 );
    label1.setBackground(Color.RED);
    label1.setOpaque(true);
    fTtickerpanel.setLocation( 0, 0 );
    fTtickerpanel.setBackground(Color.WHITE);
    fTtickerpanel.setOpaque(true);
    add( fTtickerpanel );
    paused = false;
    new Thread( new Runnable() {
    public void run() {
    while ( true ) {
    if ( !paused ) {
         int x = label1.getX() - 1;
    if ( x < -label1.getWidth() ) {
    x = getWidth();
    label1.setLocation( x, 0 );
    try {
    Thread.sleep( 20 );
    } catch ( InterruptedException exception ) {
    exception.printStackTrace();
    } ).start();
    public Dimension getPreferredSize() {
    Dimension preferredSizeOfPanel = fTtickerpanel.getPreferredSize();
    return new Dimension( preferredSizeOfPanel.width / 2,
    preferredSizeOfPanel.height );
    class TickerLabel extends JLabel {
    public TickerLabel() {
    setForeground( Color.BLUE );
    public String toString() {
    return getText();
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater( new Runnable() {
    public void run() {
    new TickerTesting();
    }

  • Hi All, my iPhone 3GS is showing rotate lock : how can I reset back to be able to see the screen/website in landscape position. Thank you.

    hi All, my iPhone 3GS is showing rotate lock : how can I reset back to be able to see the screen/website in landscape position. Thank you.

    Double tap the home button to bring up the multi-tasking bar, swipe left to right, far left is the orientation lock button, tap on/off. Tap home button when finished.

  • Position controls (casing) while in fullScreen at the bottom of the screen

    Hi,
    I need to be able to position the controls at the very bottom of the screen and have the controls stretch from left to right - anyone know the code to acheive this?
    Having looked up Capabilities in the Help - totally confused me
    Kind Regards,
    Boxing Boom

    Hi,
    No not publishing at 100% x 100% and not using a scaleMode - full screen takeover is set to false. Just need a way to align the controls to stretch along the bottom while in full screen mode. The controls are in a separate mc - would the scaleX help me out here?
    Kind Regards,
    Boxing Boom

  • How to get the caret position of component embedded in JTextPane?

    Hi great java developers ;-)
    I want to get the caret position of component which is embedded in StyledDocument / JTextPane.
    How has it to be done?
    Thank you very much!!!

    The Document doesn't know which textPane it belongs to. (It could even be shared by mulitple textPanes).
    You get the caret position of a any text component by using:
    textComponent.getCaretPosition();

  • Why does the screen shift to the last tool position

    I have a large diagram, so it involves sliding the screen back and fort to see the whole diagram.
    If I wire an item then slide the screen over to select another item, the item is selected, however, the screen shifts automatically back to were the previous tool position was. Then I have to re-slide the screen to see my newly selected item. It does this all the time with a large diagram.
    Why does LV do this?

    Save the vi, even though the title does not show "*", but save it just after your move your screen and want to maintain that view.
    Joe

  • How to lock the screen position in iOS 7?

    I know how to choose to lock the screen in landscape position, though now in iOS7 it doesn't lock.  I've tried restarting from various settings (with it to start up in unlocked position, in locked position, in upright position etc.)

    Swipe up from the bottom of the screen to display Control Panel.
    Tap the Lock icon.

  • The keyboard has become positioned near the top of the screen. How can I put it back down the bottom ?, The keyboard has become positioned near the top of the screen. How can I put it back down the bottom ?

    My keypad has become positioned at the top of the screen,hiding the text I am writing. How can I reposition it at the bottom of the screen?

    Hold down on the button iwht the keyboard on it (lower right of hte keyboard), after a few seconds a dialogue box will pop up offering you to redock the keyboard. choose it and it moves back where it was.

  • Where can customize the screen of the component in CJ20N

    now the user need to customize the component assigned to the Activity in CJ20N.
    where can customize the screen of the component in CJ20N?
    Please explain me all the steps to be required.
    Thanks in advance!

    Hi,
    unfortunately there is no field configuration for components of networks.
    Kind regards
    Peter
    PS: only possibility would be a modification -> see notes 114390 and 100180.
    Edited by: Peter Kratz  on Apr 23, 2009 9:38 AM

  • How do you return the screen to default position?

    I'm having problems with the position of the desktop screen, it appears at an angle with the left side higher than the right and the right side lower than the left which is very frustrating.
    I have updated the firmware correctly, fitted a new PRAM battery and reset the PRAM and NVRAM but still the screen appears at an angle.
    I can obviously re-position the screen in the OS manually but it is hard to get the exact position correct.
    I was hoping to return the machine to its factory settings, which I would have thought would have returned the screen to its correct straight position. Would this work? Any ideas? Os is this a fault which can't be corrected?
    Is this a common problem with the iMac G3?
    Any help or info would be appreciated!

    Hey Gazzola and Welcome to Apple Discussions,
    I can obviously re-position the screen in the OS manually but it is hard to get the exact position correct.
    Right using the monitor adjustments.
    I was hoping to return the machine to its factory settings, which I would have thought would have returned the screen to its correct straight position. Would this work?
    I doubt it. You could try using open firmware reset. From:
    http://www.macintouch.com/panfirmware.html
    "Open Firmware reset: Hold down command-option-o-f at boot until a white screen appears, and then type the following at the prompt (press return after each line):
    reset-nvram
    set-defaults
    reset-all
    Any ideas?
    Yes, most likely it's a bad capacitor in the PAV section of the iMac. This can be repaired but it's a pain. You can run an external monitor via the VGA spigot under the oval grill under in the back. Just pop it off (I use a butter knife) and plug in the external. Actually you should do that just to verify it's an internal monitor problem anyway.
    Richard

  • My send button on the iMessage screen will not function. I have tried it in every screen position ie. rotated the screen 90 degrees each time. With no results.  Any suggestions?

    My send button in iMessage does not function. I have tried it in every position ie rotated the screen 90 degrees each time but still will not send the message.  Any ideas or sugestions?

    Try this:
    First you can try signing out messages and then back in.
    Make sure IOS is updated to latest version
    Reboot device by pressing both the home button and sleep/wake (power) buttons at the same time for 10-15 seconds until the apple logo appears on the screen, then let go.
    If that doesn't work then reset the device by going to settings/general/reset/reset all settings

Maybe you are looking for