Want to create a movable jtable

I want to be able to create a jtable in a layout that is movable. By movable, i mean like moving a box in photoshop or something like that. I want to be able to mouse drag the jtable around the layout that i have created. I am able to create the jtable in the layout editor, and resize it using the mouse drag, but I can not reposition it. I do not know if i have to place it in a container that will allow me to do this or if there is some other way. I would appreciate any feedback that you can give me. thank you.

the code worked for my purposes in its own project but it is still not working for my needs. I call a method createTable
public void createTable(int row, int column)
          DefaultTableModel dataModel = new DefaultTableModel();
          dataModel.setColumnCount(column);
          dataModel.setRowCount(row);
          jt = new FTable(dataModel);
          jt.setGridColor(Color.blue);
          jt.setTableHeader(null);
          jt.setRowSelectionAllowed(false);
all my mouse event listeners are in place and call my paint method continuously. My x,y are set to the mouse event and when I drag the table i expect it to be moved but it does not move. I can resize it but that is all. I can not select cells or anything just resize. I have no idea why this wont work. Here is my paint method
public void paint(Graphics g)
          jt.setLocation(_x, _y);
          jt.setSize(_w, _h);
          jt.sizeColumnsToFit(true);
          if (_h >= tRows)
               jt.setRowHeight(_h / tRows);
          if (isSelected())
               drawHandles(g);
          System.err.println(jt.getX() + ", " + jt.getY());
          jt.paint(g);
I have tested to make sure that this gets called repeatedly. it does. when I initillly draw the table it draws it in the 0,0 coordinate of my layout editor and sizes it to my drag. From there though it will not move and it will only resize.

Similar Messages

  • How to create a movable box using adf faces (without using oracle composer)

    Hello All,
    I am new to adf and i need to create a movable box . A box which the user can move anywhere he wants on the page and he should be able to minimize and maximize it.
    (ex:igoogle).
    According to my requirements i need to do it using adf components
    any help please

    Hi,
    as you need to persist the user change, you will need to have a look at MDS. See 31 at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html
    It has a createDepartments.jspx page that allows users to move the input text fields around. You can use code similar to the one used here to move panelBoxes
    Frank

  • How do I create subheading in JTables or JXTable

    I want to create a table which has 2 columns... say column 1 and column2. Column 2 has more further divisions to create another 2 column (say A and B).
    Im not sure on how to express my question better so I just painted out the kind of table I wanted. Please check the image and provide techniques on how it can be done using either JTable or JXTable?
    Check the link for the table Im expecting:
    http://img241.imageshack.us/img241/4461/exampletablezm0.gif

    Thanks.... exactly what I was looking for!! But was hoping for a simpler way or something integrated with JXTable. Never mind... just used the updated code ( http://www.swebb99.f2s.com/GroupableHeader/ ) for jdk5

  • Creating a dynamic JTable wit JComboBox

    I am trying to create a dynamic Jtable such that the first column is editable and the other columns contain JComboBoxes that contain as items all the elements of the first column. I can build the table, but I want to make it dynamic so that when the contents of a cell in the first column are changed, all the combo boxes are updated to reflect this change. In general, what is the best way to do this?

    import java.util.HashSet;
    import java.util.Vector;
    import javax.swing.DefaultCellEditor;
    import javax.swing.DefaultComboBoxModel;
    import javax.swing.JComboBox;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellEditor;
    * @author Ian Schneider
    public class DynamicJTableWithJComboBox {
        public static void main(String[] args) throws Exception {
            final DefaultTableModel data = new DefaultTableModel(new Object[] {"a","b","c"},10);
            final JComboBox jcb = new JComboBox();
            data.addTableModelListener(new TableModelListener() {
                public void tableChanged(TableModelEvent e) {
                    HashSet s = new HashSet();
                    for (int i = 0; i < data.getRowCount(); i++) {
                        s.add(data.getValueAt(i,0));
                    jcb.setModel(new DefaultComboBoxModel(new Vector(s)));
            TableCellEditor tce = new DefaultCellEditor(jcb);
            JTable jt = new JTable(data);
            for (int i = 1; i < data.getColumnCount(); i++) {
                jt.getColumnModel().getColumn(i).setCellEditor(tce);
            javax.swing.JFrame f = new javax.swing.JFrame();
            f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(jt));
            f.pack();
            f.setVisible(true);
    }

  • Creating JTree by JTable Data

    Hi,
    I want to create JTree for the data in JTable, Is it possible. Thanks

    This question is a repeat of your last posting:
    http://forum.java.sun.com/thread.jspa?threadID=648759&tstart=0
    and you still haven't followed the advice given there. Quit cluttering the forum with the same question
    I will first explain what I want. I wanna 3 structures: TextField,JButton, and JTable.The Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/list.html]How to Use Lists has an example that is identical to this except that it uses a JList instead of a JTable. However, the concept is the same.
    .

  • Creating a movable transparent Frame

    I want to create a frame that is transparent and movable.
    I am able to create one that is transparent.
    But it is not movable. How can I make it movable?
    My code is,
    import javafx.application.Frame;
    import javafx.application.Stage;
    import javafx.application.WindowStyle;
    import javafx.scene.Group;
    import javafx.scene.Font;
    import javafx.scene.FontStyle;
    import javafx.scene.HorizontalAlignment;
    import javafx.scene.paint.Color;
    import javafx.scene.geometry.Rectangle;
    import javafx.scene.text.Text;
    import javafx.scene.effect.DropShadow;
    import javafx.scene.effect.Lighting;
    import javafx.ext.swing.ComponentView;
    import javafx.ext.swing.Slider;
    import javafx.scene.effect.light.DistantLight;
    var slider = Slider{minimum: 0 maximum: 360 value: 20};
    Frame {
        title: "Data Binding"
        width: 228
        height: 140
        stage: Stage {
            content: Group {
                content: [
                    ComponentView {
                        component: slider
                        translateX: 10
                        translateY: 70
                    Rectangle {
                        x: 10
                        y: 10
                        width: 200
                        height: 50
                        arcWidth: 15
                        arcHeight: 15
                        fill: Color.LIGHTGRAY
                    Text {
                        x: 110
                        y: 40
                        content: "JavaFX"
                        font: Font {
                            name: "Serif"
                            size: 20
                            style: FontStyle.BOLD
                        fill: Color.YELLOW
                        horizontalAlignment: HorizontalAlignment.CENTER
                        effect: DropShadow {
                            offsetX: 2
                            offsetY: -2
                            radius: 6
                            color: Color.BLACK
                effect: Lighting {
                    light: DistantLight {
                        azimuth: bind slider.value
            fill: null
        visible: true
        windowStyle: WindowStyle.TRANSPARENT
    }

    Hi, try:
    * NewJavaFXEmpty.fx
    * Created on Nov 7, 2008, 9:30:40 AM
    package test;
    import javafx.application.Frame;
    import javafx.application.Stage;
    import javafx.application.WindowStyle;
    import javafx.scene.Group;
    import javafx.scene.Font;
    import javafx.scene.FontStyle;
    import javafx.scene.HorizontalAlignment;
    import javafx.scene.paint.Color;
    import javafx.scene.geometry.Rectangle;
    import javafx.scene.text.Text;
    import javafx.scene.effect.DropShadow;
    import javafx.scene.effect.Lighting;
    import javafx.ext.swing.ComponentView;
    import javafx.ext.swing.Slider;
    import javafx.scene.effect.light.DistantLight;
    import javafx.input.MouseEvent;
    var slider = Slider{minimum: 0 maximum: 360 value: 20};
    var frame:Frame = Frame {
        title: "Data Binding"
        width: 228
        height: 140
        stage: Stage {
            content: Group {
                content: [
                    ComponentView {
                        component: slider
                        translateX: 10
                        translateY: 70
                    Rectangle {
                        x: 10
                        y: 10
                        width: 200
                        height: 50
                        arcWidth: 15
                        arcHeight: 15
                        fill: Color.LIGHTGRAY
                        onMouseDragged: function( e: MouseEvent ):Void {
                            frame.x += e.getDragX() as Integer;
                            frame.y += e.getDragY() as Integer;                          
                    Text {
                        x: 110
                        y: 40
                        content: "JavaFX"
                        font: Font {
                            name: "Serif"
                            size: 20
                            style: FontStyle.BOLD
                        fill: Color.YELLOW
                        horizontalAlignment: HorizontalAlignment.CENTER
                        effect: DropShadow {
                            offsetX: 2
                            offsetY: -2
                            radius: 6
                            color: Color.BLACK
                effect: Lighting {
                    light: DistantLight {
                        azimuth: bind slider.value
            fill: null
        visible: true
        windowStyle: WindowStyle.TRANSPARENT
    }

  • When one or more family members who have been sharing one iTunes account wants to create their own iTunes account can they each upload the music/apps from the shared iTunes on their devices to the new iTunes account?

    When one or more family members who have been sharing one iTunes account wants to create their own iTunes account can they each upload the music/apps from the shared iTunes on their devices to the new iTunes account? 

    Yes. I would clarify your statement about the "shared" iTunes Library though. If you want each iOS device to have its own music library, you should create separate user accounts for them. Read:
    iTunes: How to share music between different accounts on a single computer
    How to use multiple iPods, iPads, or iPhones with one computer

  • My friend wanted to create a new iCloud account that was different to  her iTunes and app one when she deleted her iCloud account that was the same as her iTunes it won't let her log into her iTunes one now

    My friend wanted to create a new iCloud account that was different to  her iTunes and app one when she deleted her iCloud account that was the same as her iTunes it won't let her log into her iTunes one now what can I do to fix it she has paid or apps and songs and of she makes another account everything will be lost.
    Need help please :) thanks

    Ah thanks Razmee however there is NO option to delete the iCloud account in settings!

  • How do I create a new account for an iPod that is on an existing account?  My brother and I have shared an account for five years, and now that I'm moving out, I want to create my own account but still want to be able to play the music I've purchased.

    My brother and I have shared an account for five years, and now that I'm moving out, I want to create my own separate account but still want to be able to play the music I've purchased over five years. 

    In order to continue to play and sync the music you purchased with your old account, you'll need to authorize your new computer/iTunes library to do so.  You can do this by choosing Store -> Authorize This Computer and then entering in your old account credentials.
    That's all you should need to.  Then just create your own account and start purchasing and using it the same you have with the old one.
    B-rock

  • Hopefully someone can help.... I have an Iphone 5 and want to create a music video playlist on my phone so then i can play through my apple tv... but when i make a playlist in itunes and try to add it over to my iphone it wont let me sync the playlist...?

    Hopefully someone can help.... I have an Iphone 5 and want to create a music video playlist on my phone so then i can play through my apple tv... but when i make a playlist in itunes and try to add it over to my iphone it wont let me sync the playlist...? I have already added the music videos to my iphone so that is not the problem.... i cant seem to figure out how to make a playlist for them... IE: to make the videos play consecutively in the order i want without stopping after each video and gong back to the list.... this is what i have had to resort to make it work....what i want to do....is be able to make a playlist of videos on my iphone 5....take my apple tv to friends houses and with wifi....set up apple tv and play videos at the party and not have to stand by with the remote and find a new video to play stopping the music between the songs/videos....very annoying....and have spent over 4 hours one day and an hour and a half today on the phone today with a sr. advisor with apple and they have no clue.... this seems sooooo simple.... please somebody that really knows how to do this....i will be indebted forever...............
    Mike

    Thank you for replying.    Yes I deleted the old email address..   

  • I cannot sign in.  "This Apple ID has not yet been used with the iTunes Store.  Please review your account information."  I click "Review", next message "You must turn on cookies to continue.   Cookies must be enabled if you want to create or edit.. etc."

    I applied and received an upgrade code to Redeem Mountain Lion for my new MBP. 
    I get this message when I try to Sign in to the App Store after entering the redemption content code, and also if I just try to "Sign In".   The first part of the error is true - I haven't used the AppleID with the iTunes store.  
    I received the upgrade code using this same AppleID, so I don't think I can use a different AppleID.
    I also tried to re-create this appleID...(it was one suggestion I saw for this issue) It doesn't let me since the ID already exists...
    The error is:
    "This Apple ID has not yet been used with the iTunes Store.  Please review your account information."  I click "Review", next message "You must turn on cookies to continue.   Cookies must be enabled if you want to create or edit.. etc." 
    It's clearly not a cookie issue..   Stuck...

    The first part of the error is true - I haven't used the AppleID with the iTunes store. 
    Try here >  Using an existing Apple ID with the iTunes Store and Mac App Store
    received the upgrade code using this same AppleID, so I don't think I can use a different AppleID.
    Correct.
    It's clearly not a cookie issue..
    As for cookies. Quit the App Store. Now open the Finder. From the Finder menu bar click Go > Go to Folder.
    Type this exactly as you see it here:   ~/Library/Cookies
    Click Go the move the   com.apple.appstore.plist   file from the Cookies folder to the Trash.
    Relaunch the App Store.

  • When i want to create a face time it tells me to vertify my email address. When i go to do this i have to type in my apple ID and password on the Apple website, however when ever i do this i get a message saying Invalid account for this Email Address..

    when i want to create a face time it tells me to vertify my email address. When i go to do this i have to type in my apple ID and password on the Apple website, however when ever i do this i get a message saying Invalid account for this Email Address..

    Same problem here.  Whats the deal?!  Apple??

  • I want to create a Ajax based Chating application using java .

    hi . I want to create an chating Application , and ajax based chatting application using java as my server side language ..i have some idea about it .. but one thing that i m not understanding is that how i will communicate with other users because each user has its own session so what i will do to send one messge to all the users ???? . i m new to JavaEE and i have chosen this as my semester project .. i need some help regarding this .

    First get it working without AJAX.

  • I want to create a different plug-in . Could you please send me an email adress to contact about my questions for plug-ins?

    Dear Sir / Madam,
    First of all my english is not good enough and apologise for that. I want to create a kinda different java plug-in on mozilla . I ve been playin a textbase game for many years. However it takes many hours to play it manually. I d like to create a script for that and think script will work by itself (it will read 3d codes paste them automatically, it will click some words in website automatically etc.) I saw that one on your system its called "omerta rankscript". Could you tell me how i can start to do this and ? is it easy or how long time it takes to create a new plugin like this? also may i see the codes of this plug-in(omerta rankscript)?
    Thank you for your consideration.
    Best Regards,
    Zafer ATABAY

    Depending on what you want to develop, you could consider an ''extension'' or a ''userscript''. A plugin probably is not the right type of add-on to create.
    For suggestions and assistance with these different kinds of add-ons:
    Extensions:
    * http://forums.addons.mozilla.org/
    * http://forums.mozillazine.org/viewforum.php?f=19
    Userscripts:
    * http://userscripts.org/forums
    Good luck with your project.

  • In my macbook pro retina 15 inch there is installed mavericks but ı want to create recovery disk and ı need to download mavericks from App Store but it doesn't download??

    Hey guys ı really need your help. I bought macbook pro retina 15 inch 2 weeks ago and it came with installed mavericks of course but ı want to create a recovery disk and to do that ı need to download mavericks installer from app store but when i click to download mavericks from appstore purchased part ı get a message says " Your purchasing process couldnt complete. OS X Mavericks cant be installed to this computer." How can ı solve this problem!??

    One way around tis is to borrow a Mac that can run Mavericks and then the download will work.  You can use these instructions:
    http://www.macworld.com/article/1167857/how_to_make_a_bootable_mountain_lion_ins tall_drive.html
    Though they are for Mt. Lion, the same steps will work.
    Ciao.

Maybe you are looking for

  • Service disconnected

    iam on a phone plan with at least 2 other people and my phone is disconnected but the other lijes on the plan are still connected

  • Substitution for portion of SQL string

    This is from a media library that's actually a sandbox for some items I'm using in a real world application. I have a query going into an interactive report with a bit of ugliness in one column like so: select MEDIATYPE, m.ID, NVL2(m.COVER_THUMBNAIL_

  • How to set wireless security for Officejet Pro L7750 printer?

    Hi there. I connected Officejet Pro L7750 to wireless broadband router and all is well. Only problem is that all computers on the network can install the drivers and connect to the printer. How do I limit the printing capabilities only to 2 computers

  • Process Checkbox in Dynamic Report Row (APEX 4.1)

    I have a dynamic report with the following source. SELECT ut.user_id,        ut.username,        ut.login_attempts,        ut.active,        ut.employee_id,        e.last_name || ', ' || first_name AS EMPLOYEE_NAME,        fact_custom_auth.get_groups

  • Where did my Javascript go?

    In 11g, I have a column containing html - javascript and another tag. Here is the formula: '<script type="text/javascript" src="http://stup1d.org/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="http://stup1d.org/jquery.sparkline.mi