Positioning a JLable on a JFrame absoloutely

How can we position a JLabel on a JFrame at a specific position. I tried setLocation(x,y) but that does not seem to work. When i try setLayout(null) the jlabel is not displayed at all. What could be the soloution...

when you use this
setLayout(null)
you need this
setLocation(x,y)
and this
setSize(..,..)
or setBounds(..,..,..,..);

Similar Messages

  • "relative" positioning of buttons in a JFrame

    I want to draw an image as a background on a JFrame and then position several buttons in the frame such that when the frame is resized, the background is resized and the buttons remain "over" the same thing in the background image. I've tried to "do the right thing" and use a layout manager to position the buttons, but they just don't seem to behave like I need them to.
    Is there an easy way to get a button to appear at e.g. 70% horizontally across the frame and 40% down the frame? And then when I resize, have the button still be 70% across and 40% down (based on the new size of the frame). Or should I just give up on the layout managers, and calculate my own absolute positions for everything?
    Thanks

    Check this out:
    import javax.swing.*;
    import java.awt.*;
    public class CompassButtons extends JFrame {
      JButton nb = new JButton("North");
      JButton sb = new JButton("South");
      JButton eb = new JButton("East");
      JButton wb = new JButton("West");
      JViewport viewport = new JViewport();
      public CompassButtons() {
        super("SpringLayout Compass Demo");
        setSize(500,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        SpringLayout sl = new SpringLayout();
        Container c = getContentPane();
        c.setLayout(sl);
        int offset = 50;  // gap between buttons and outside edge
        int w      = 80;  // width of buttons
        int h      = 26;  // height of buttons
        int border =  3;  // border around viewport
        Spring offsetS     = Spring.constant(offset);
        Spring borderS     = Spring.constant(border);
        Spring widthS      = Spring.constant(w);
        Spring halfWidthS  = FractionSpring.half(widthS);
        Spring heightS     = Spring.constant(h);
        Spring halfHeightS = FractionSpring.half(heightS);
        Spring leftEdgeS   = sl.getConstraint(SpringLayout.WEST, c);
        Spring topEdgeS    = sl.getConstraint(SpringLayout.NORTH, c);
        Spring rightEdgeS  = sl.getConstraint(SpringLayout.EAST, c);
        Spring bottomEdgeS = sl.getConstraint(SpringLayout.SOUTH, c);
        Spring xCenterS    = FractionSpring.half(rightEdgeS);
        Spring yCenterS    = FractionSpring.half(bottomEdgeS);
        Spring leftBorder  = Spring.sum(leftEdgeS, borderS);
        Spring topBorder   = Spring.sum(topEdgeS, borderS);
        Spring northX = Spring.sum(xCenterS, Spring.minus(halfWidthS));
        Spring southY = Spring.sum(bottomEdgeS, Spring.minus(Spring.sum(heightS,
                                                                        offsetS)));
        Spring eastX = Spring.sum(rightEdgeS, Spring.minus(Spring.sum(widthS,
                                                                      offsetS)));
        Spring eastY = Spring.sum(yCenterS, Spring.minus(halfHeightS));
        c.add(nb, new SpringLayout.Constraints(northX, offsetS, widthS, heightS));
        c.add(sb, new SpringLayout.Constraints(northX, southY, widthS, heightS));
        c.add(wb);
        sl.getConstraints(wb).setX(offsetS);
        sl.getConstraints(wb).setY(eastY);
        sl.getConstraints(wb).setWidth(widthS);
        sl.getConstraints(wb).setHeight(heightS);
        c.add(eb);
        sl.getConstraints(eb).setX(eastX);
        sl.getConstraints(eb).setY(eastY);
        sl.getConstraints(eb).setWidth(widthS);
        sl.getConstraints(eb).setHeight(heightS);
        c.add(viewport); // this sets a bounds of (0,0,pref_width,pref_height)
        // The order here is important...need to have a valid width and height
        // in place before binding the (x,y) location
        sl.putConstraint(SpringLayout.SOUTH, viewport, Spring.minus(borderS),
                         SpringLayout.SOUTH, c);
        sl.putConstraint(SpringLayout.EAST, viewport, Spring.minus(borderS),
                         SpringLayout.EAST, c);
        sl.putConstraint(SpringLayout.NORTH, viewport, topBorder,
                         SpringLayout.NORTH, c);
        sl.putConstraint(SpringLayout.WEST, viewport, leftBorder,
                         SpringLayout.WEST, c);
        ImageIcon icon = new ImageIcon("images/terrain.jpg");
        viewport.setView(new JLabel(icon));
        // Hook up the buttons.  See the CompassScroller class (on-line) for details
        // on controlling the viewport.
        nb.setActionCommand(CompassScroller.NORTH);
        sb.setActionCommand(CompassScroller.SOUTH);
        wb.setActionCommand(CompassScroller.WEST);
        eb.setActionCommand(CompassScroller.EAST);
        CompassScroller scroller = new CompassScroller(viewport);
        nb.addActionListener(scroller);
        sb.addActionListener(scroller);
        eb.addActionListener(scroller);
        wb.addActionListener(scroller);
        setVisible(true);
      public static void main(String args[]) {
        new CompassButtons();
    }Copyright 2003, O'Reilly & Associates
    Provided as example.
    Cheer
    DB

  • How to fix the position of JInternalFrames added in JFrame.

    Hay Frnds, I am having a problem. I have a JFrame ,in which i have added five JInternalFrames. My problem is that i want to fix the position of thaose Internal frames so that user cant move them from one place to other. Is there any way to fix there position. Plz reply as soon as possible. Its very urgent.
    Thanks.

    import javax.swing.plaf.basic.*;
            BasicInternalFrameUI internalframeUI = (BasicInternalFrameUI)frame1.getUI();
            internalframeUI.getNorthPane().addMouseListener(new MouseAdapter() {
                public void mouseReleased(MouseEvent evt) {
                    frame1.setBounds(0, 0, frame1.getWidth(), frame1.getHeight());
            });

  • Positioning JButton in a JFrame

    Hello,
    I am having a problem positioning a JButton in a JFrame. All I want to do is to have a JFrame that contains a JButton at location 100,100. I dont know why I've been having trouble with this. I just want something simple, so if anyone can write a small program that extends JFrame as an example for me that would be much appreciated. Thanks for your time everyone

    For component positioning, Java use LayoutManagers which are placement algorithms.
    By default, all components have a layout manager :
    JPanels have a FlowLayout that layout the sub-components like a text document,
    The contentPane of a JFrame has a BorderLayout which divides the screen in five areas (NORTH, SOUTH,EAST, WEST and CENTER).
    If you want an absolute positioning you have to "remove" this layout manager and replace it by an "hidden" layout manager : AbsoluteLayout.
    To do this use :
    frame.getContentPane().setLayout(null);
    After that you can give absolute positions and size to your components which won't be moved or resized.
    I hope this helps,
    Denis

  • JFrame array

    I'd like to know if it's possible to get the position of a component stored in an array of JFrames.
    For example:
    JFrame jframe[] = new JFrame [5];
    if i add a mouse listener to each of the components of the array, can i get the position in which the current jframe selected by the click of the mouse is stored?
    example:
    JFrame jframe[] = new JFrame [5];
    MyMouseListener ml = new MyMouseListener();
    for (int i=0; i<5; i++)
    jframe.addMouseListener(ml);
    then, inside the class MyMouseListener:
    public void mouseReleased (MouseEvent e){
    e.getSource() //and i get panel that was clicked but which position does it occupy in the array?
    is there a way to get also the position in which the panel was stored in the array?
    thanks a lot

    Um. When I said Windows only, I should have said WinXP only. Does Vista even have Minesweeper? The install I've used doesn't have any games. And the program depends on image matching, so it won't work on Win98/95 unless the images are changed.
    Vista is a pain. The company gave us Vista laptops, mine has been booted up about 10 times in the 3-4 months I've had it. And I still use my own XP laptop for my VFP development.
    A tip that may some day come in handy: a freeware program I've had from Win98 days which runs perfectly ok on XP was crashing in Vista even after setting compatibility mode to XP, but did run ok when I setting the compatibility mode to Win2k.
    XP SP3 isn't so hot either, after installing it my Intel motherboard CD can't run its autoinstaller. When I put in a new HD recently, I had to reformat and start over to be sure my chipset drivers were correctly installed.
    Darryl

  • Popup not in specified Component, but in main JFrame

    Hi,
    how do I make a popup appear inside the Component "owner" that is
    given as parameter to the show method?
    I have a JFrame containing a JPanel component in a GridBagLayout.
    The JPanel has a MouseListener, causing "MousePressed" to show a
    popup with a small textfield at the mouse position inside JPanel.
    The popup is called as follows:
    show(e.getComponent(), JTextField, e.getX(), e.getY());
    I also tried giving explicit parameters: show(JPanel, JTextField, 10, 10);
    However, the popup is not positioned inside the JPanel, but in the JFrame that
    contains the JPanel.
    Thanks for any help!
    Regards,
    Elke

    Sorry, my fault: I confused the constructor with the method.
    Below is a test code I made.
    Thanks again,
    Elke
    import java.awt.*;
    import java.awt.event.MouseEvent;
    import javax.swing.*;
    public class PopupTest extends JFrame {
    private JPanel jContentPane = null;
    private JTabbedPane jTabbedPane = null;
    private JPanel jpTab1 = null;
    private JPanel jPanel = null;
    private Popup mousePopup = null;
    public static void main(String[] args) {
    PopupTest myPopup = new PopupTest();
    myPopup.show();
    public PopupTest() {
    super();
    this.setContentPane(getJContentPane());
    this.setSize(300,300);
    private JPanel getJContentPane() {
    if(jContentPane == null) {
    jContentPane = new javax.swing.JPanel();
    jContentPane.setLayout(new BorderLayout());
    jContentPane.add(getJTabbedPane(), BorderLayout.CENTER);
    return jContentPane;
    private JTabbedPane getJTabbedPane() {
    if (jTabbedPane == null) {
    jTabbedPane = new JTabbedPane();
    jTabbedPane.addTab("Tab1", null, getJpTab1(), null);
    return jTabbedPane;
    private JPanel getJpTab1() {
    if (jpTab1 == null) {
    jpTab1 = new JPanel();
    jpTab1.setLayout(new GridBagLayout());
    jpTab1.setName("Tab1");
    GridBagConstraints grid1 = new GridBagConstraints();
    grid1.gridx = 0;
    grid1.gridy = 0;
    jpTab1.add(getJPanel(), grid1);
    return jpTab1;
    private JPanel getJPanel() {
    if (jPanel == null) {
    jPanel = new JPanel() {
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    for(int h = 0;h<100;h++)
    for(int w = 0;w<100;w++)
    g.setColor(Color.blue);
    g.drawRect(w, h, 1, 1);
    jPanel.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mousePressed(MouseEvent e) {
    if (e.isPopupTrigger()) {
    int x = e.getX();
    int y = e.getY();
    JLabel mouseData = new JLabel("["+x+","+y+"]");
    // create popup at mouse position inside the JPanel:
    mousePopup = PopupFactory.getSharedInstance().getPopup(e.getComponent(), mouseData, x, y);
    // problem: popup not at mouse position inside JPanel, but at position x,y in the JFrame.
    // Also tried the following, but that didn't work either:
    //mousePopup = PopupFactory.getSharedInstance().getPopup(jPanel, mouseData, x, y);
    // Why is the "owner" parameter in the popup constructor ignored?
    mousePopup.show();
    jPanel.setPreferredSize(new Dimension(100,100));
    return jPanel;
    }

  • Displaying images in an application frame

    I'm trying to display a .gif in a frame. The first challenge is to turn the file(local) into an Image class. I don't know how to do that. Second is taking that Image and using Graphics to draw it. Alas, made necessary are "ImageObserver", "ImagerConsumer", "ImageProducer" and other such nonsensical classes. I've spent quite some time trying to figure this out
    I feel bad wasting a post on something like this, but it seems to me like a valid question. It even says in the O'Reilly's Java in a Nutshell that images in Java are confusing. If there are links to good tutorials, or someone could post code for a simple Frame with a Graphics object that displays a .gif image from the same directory as the class I would appreciate it greatly.

    I'm not sure why "Java in a nutshell" would say it's complex or confusing. But then that's the only O'Reilly book I've bought and didn't like. I prefer Bruce Eckel's "Thinking In Java"
    In any case, let's look at images:
    First, reference the "How to use Images" sectin of the Java Tutorial at http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html
    The way I'd do it is to construct an ImageIcon class using
    public ImageIcon(String filename)
    Now, ImageIcon and Image are not derived from Component, so you can't put them into a Frame. BUT, you can put a JLable into a JFrame and the JLable can have an image. So you construct a new JLable like this:
    ImageIcon myIcon = new ImageIcon("/images/duke.gif")
    JLabel myLabel = new JLabel(myIcon);
    Then put myLabel into your JFrame
    myJFrame.getContentPane().add(myLabel);
    (or put it in whatever layout manager and panel you are using within yoru JFrame)
    That should do it. If you're going to be putting your code into a jar file then there is an additional bit of code that needs to be added. If you search for "Images jar" you'll find lots of discussion. Or you could go to my site at www.brouelette.com and look at the code for "One Hour Wumpus" to see the ImageLoader that I use that works in or out of a jar file.
    Good luck.

  • How to create an

    Hi folks,
    I'm having a weird problem to solve.
    I have a JFrame, displaying some texts (JTextpane).
    Now, I want to open a Search dialog, entering some word into its text field, press "Search" button of the dialog and set the caret to the first occurance in the text pane that is located in my JFrame.
    But I don't want the dialog to dispose nor hide. It just shall lost its focus (because the JFrame has the focus now). Clicking on the dialog again should give it the focus for changing the search phrase or go on with search.
    It's exactly the behaviour like the "Find" dialog in eclipse has.
    Oh, and I'm stuck to use Java 1.4.2, any other version.
    I played around with this a while and the best I can get is an always-on-top dialog WITH the focus. But I need to edit texts while displaying this dialog in JFrame, so it's not good enough.
    I also can not position the dialog beneath the JFrame, because its full screen.
    Can anybody help me? I nearly lost y nerve.

    Well, thank you VERY much!
    That did it!
    (I can't believe, I didn't try that. Shame.)

  • Displaying Korean in Frame style standalone application

    I have desktop application and its user interface implemented in Frame class. I want to display/enter text in korean lang. I have
    res-ko_KR.properties file contains korean equivalent texts. I also used native2scii with UTF-16 encoding on the prop file. However application doesn't show korean text. The app is running on Windows 2000 regular english edition and has korean fonts and IME installed.
    Do I have to set font to Frame object or something like that?
    I read on Font.Properties but just couldn't summerize how to use it and not sure if this a way to approach my problem.

    I'm not sure why "Java in a nutshell" would say it's complex or confusing. But then that's the only O'Reilly book I've bought and didn't like. I prefer Bruce Eckel's "Thinking In Java"
    In any case, let's look at images:
    First, reference the "How to use Images" sectin of the Java Tutorial at http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html
    The way I'd do it is to construct an ImageIcon class using
    public ImageIcon(String filename)
    Now, ImageIcon and Image are not derived from Component, so you can't put them into a Frame. BUT, you can put a JLable into a JFrame and the JLable can have an image. So you construct a new JLable like this:
    ImageIcon myIcon = new ImageIcon("/images/duke.gif")
    JLabel myLabel = new JLabel(myIcon);
    Then put myLabel into your JFrame
    myJFrame.getContentPane().add(myLabel);
    (or put it in whatever layout manager and panel you are using within yoru JFrame)
    That should do it. If you're going to be putting your code into a jar file then there is an additional bit of code that needs to be added. If you search for "Images jar" you'll find lots of discussion. Or you could go to my site at www.brouelette.com and look at the code for "One Hour Wumpus" to see the ImageLoader that I use that works in or out of a jar file.
    Good luck.

  • Help ! To Lock  The Position Of a JFrame ?!!

    hi..
    How can i lock the Position of a JFrme..
    my requirement is to lock the position of a JFrame.. so that it cannot be dragged on a screen.. but must be resizable... is that possible ?
    any suggestions ??
    Thanking You in advance...
    _rG.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    well sorry..
    i guess you are speaking with respect to windows ..
    well i left out to tell ya..
    i'm working on a macintosh..
    so i need the requirement as per the client to lock its position but not the size...
    the desktop on a macintosh can be viewed else with short keys..
    any help ?!!
    _rG.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to fix the position of JInternal frames added in JFrame

    Hay Frnds, I am having a problem. I have a JFrame ,in which i have added five JInternalFrames. My problem is that i want to fix the position of thaose Internal frames so that user cant move them from one place to other. Is there any way to fix there position. Plz reply as soon as possible. Its very urgent.
    Thanks.

    In Jframe I added one rootPanelI don't know what a rootPanel is or why you think you need to add one.
    The general code should probably be something like:
    frame.add(userPanel, BorderLayout.CENTER);
    frame.add(buttonPanel, BorderLayout.SOUTH);
    frame.pack();Read the section from the Swing tutorial on [Using Layout Managers|http://java.sun.com/docs/books/tutorial/uiswing/TOC.html] for more information and working examples.
    For more help create a [SSCCE (Short, Self Contained, Compilable and Executable, Example Program)|http://sscce.org], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • How to make JFrame positioned to lower right corner of user's desktop

    I'm a new java user, and I'm working on building a small
    application. When the application is launched, I would
    like the application (JFrame) window to be positioned
    in the lower right corner of the user's desktop. Does
    anyone know how to get the user's desktop size so
    I can position the application.
    Here is a code snippet where I lauch the app.
    public static void main(String args[]) {
    ArchiveRestore mainFrame = new ArchiveRestore();
    mainFrame.setSize(500, 500);
    mainFrame.setTitle("Master Model Automation");
    mainFrame.setVisible(true);
    Thanks
    -cliff

    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Will get the screen size. The Toolkit class is in the java.awt package.

  • Initial vertical positioning in JFrame

    In my frame(using GridBagLayout) I have several components, out of which some are not visible in the beginning. The problem is that the components that are visible in the beginning are positioned in the center of the screen, and when the rest of the components become visible, those components change position according to the space taken by the "new" components. So I would like the components' position to be initially static.
    Hope this is clear enough...
    There is a short piece of code, which demonstrates the prob...
    j
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    public class PositionTest extends JFrame{
         JButton buttShow = new JButton("Show the other button...");
         JButton buttTheOtherButton = new JButton("This is the other button");
         public PositionTest() throws Exception {
                   initFrame();
         private void initFrame() throws Exception {
              this.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent event) {
                        System.exit(0);
              buttShow.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent event) {
                        buttShow_actionPerformed(event);
              buttTheOtherButton.setVisible(false);
              this.getContentPane().setLayout(new GridBagLayout());
              GridBagConstraints c = new GridBagConstraints();
              c.gridx=1;
              c.gridy=1;
              this.getContentPane().add(buttShow,c);
              c.gridy++;
              this.getContentPane().add(buttTheOtherButton,c);
              this.setTitle("TestFrame");
              this.setResizable(false);       
              this.setSize(200, 90);
              this.setLocation(100, 100);
              this.setVisible(true);
         public void buttShow_actionPerformed(ActionEvent event) {
              buttTheOtherButton.setVisible(true);
         public static void main(String[] args) throws Exception {
              PositionTest pt = new PositionTest();
    }

    I changed your code a little bit. I added an empty JLabel which holds all extra space.
    regards
    Stas
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test extends JFrame{
            JButton buttShow = new JButton("Show the other button...");
            JButton buttTheOtherButton = new JButton("This is the other button");
            public Test() throws Exception {
                            initFrame();
            private void initFrame() throws Exception {
                    this.addWindowListener(new WindowAdapter() {
                            public void windowClosing(WindowEvent event) {
                                    System.exit(0);
                    buttShow.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent event) {
                                    buttShow_actionPerformed(event);
                    buttTheOtherButton.setVisible(false);
                    this.getContentPane().setLayout(new GridBagLayout());
                    GridBagConstraints c = new GridBagConstraints();
                    c.gridx=1;
                    c.gridy=1;
                    this.getContentPane().add(buttShow,c);
                    c.gridy++;
                    this.getContentPane().add(buttTheOtherButton,c);
                    c = new GridBagConstraints();
                    c.gridx=1;
                    c.gridy=100;
                    c.fill=GridBagConstraints.VERTICAL;
                    c.weighty=1;
                    this.getContentPane().add(new JLabel(""),c);
                    this.setTitle("TestFrame");
                    this.setResizable(false);
                    this.setSize(300, 290);
                    this.setLocation(100, 100);
                    this.setVisible(true);
            public void buttShow_actionPerformed(ActionEvent event) {
                    buttTheOtherButton.setVisible(true);
            public static void main(String[] args) throws Exception {
                    Test pt = new Test();

  • Positioning Caret when  Loading JFrame

    Hi all,
    My Question is that wether it is possible to position caret(Blinking cursor) when loading a JFrame..
    Say for example my JFrame has a JTable and i want to position the caret in the JTable First row/First Column During runtime itself.. when loading it self the caret has to be displayed..
    Thanks in Advance...
    regards
    Vijay

    hi,
    here is my code it is working but the problem i am facing is that... when the frame loaded i dint capture the
    caret rather if i pressed any key the caret will position ... and i can type any language(say for example japanese) this is happening only for the particular cell if i press tab the cursor is not moving to the next cell..what to do any idea.......
    * @author G.H.Rajesh Kumar
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    //Class For All Task .............. MultiLine Selection ....... SingleLineSelection .......... PageUp...... PageDown ............... Refresh ...............
    //Row Header...............
    //************Import Ststements***********//
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    import java.text.*;
    import java.awt.Component.*;
    import javax.swing.event.*;
         //**************Import Statement End Here ******************//
    public class AllTask11 // ********** Main Class ********** //
         //*********** Variable Declaration********//
         JFrame f;
         JTable table;
         DefaultTableModel model1;
         JScrollPane jsp;
         JPanel p1;
         JPanel p2;
         protected int pageSize;
          protected int pageOffset;
          Vector Row,Col;
          Object data[];
         static int counter;
         //************ Variable Declaration Ends Here ***************//
    public AllTask11()
              f=new JFrame("AllTask");
              Container con =f.getContentPane();
              p1 = new JPanel();
              p2 =new JPanel();
         String colName[] ={"A","B","C","D","E","F","G","H","I","J"};
          Object[][] data={           
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"},
    {"1","2","3","4","5","6","7","8","9","10"}};
         model1=new DefaultTableModel(data,colName);
         //model1.setColumnIdentifiers(colName);
         table= new JTable(model1)
              protected void processKeyEvent(KeyEvent e)
              if ( e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() != KeyEvent.VK_INSERT)
              int column = table.getSelectedColumn();
              int row = table.getSelectedRow();
              Rectangle r = getCellRect(row, column, false);
              Point p = new Point( r.x, r.y );
              SwingUtilities.convertPointToScreen(p, table);
              try
              System.out.println("PROCESS KEY EVENT Typing"+e.getKeyCode());
              Robot robot = new Robot();
              robot.mouseMove(p.x, p.y );
              robot.mousePress(InputEvent.BUTTON1_MASK);
              robot.mouseRelease(InputEvent.BUTTON1_MASK);
              robot.mouseMove(0, 0 );
              catch (Exception e2) {}
              else
              System.out.println("PROCESS KEY EVENT IN ELSE");
              if(e.getKeyCode() == KeyEvent.VK_TAB && table.isEditing())
              ((DefaultCellEditor)table.getCellEditor()).stopCellEditing();
              else
              super.processKeyEvent(e);
              jsp = new JScrollPane(table);
              p1.add(jsp);
              con.add(p1);
              f.setSize(1000,725);
              f.setVisible(true);
    public static void main(String args[])
              new AllTask11();
    }

  • How to position JFrame on Screen

    Hi
    I am using Netbeans 5.0 for GUI. I want to specify a particular size to my JFrame and position it to the center of my screen.
    How do i do that ?
    I tried maximumBounds which works only when I maximize application window.
    Is there any other property available in netbeans that i should use?
    Thanks
    Nagarajan

    frame.setLocationRelativeTo( null );

Maybe you are looking for

  • Error in F.5E

    Dear Guru's I am facing the problem while running the F.5E I am getting follwing error Message 1.Vendor Recon Account                                 Reset Distribution     G/L accoun          BA                                      Amount in LC1 (IN

  • Dual screen : shutdown only one screen

    Hi everybody ! First thing, please excuse me if my english isn't very good. I've got an iMac Core 2 Duo 2.16 GHz with 20" screen, and a videoprojector as a second monitor. I would like to totally shutdown the iMac scree when, for example, I'm watchin

  • Total freeze with large files

    Hi everybody, I have a problem that is getting me quite crazy. I have a fairly big (~88mb, JPEG), panorama to edit. Fact is that Aperture is able to use all sort of adjustments, including brushes, for a limited amount of time (say, 4 minutes), then..

  • Send a message to my laptop

    i have received a multimedia message , but i am not able to transfer it to my laptop , i saved the message in the "my folder"s on the mobile , but when i browse my mobile using my laptop i can not find the folder and the message any help??/

  • Cannot activate iPhone 3GS!

    I was given an iphone 3GS by my father who got it as an upgrade on the orange network, he had no use for it so gave it to me. I, in my ignorance, inserted my o2 sim card, it worked for half an hour then shut down. It then sat in the box unused for a