Hi I am trying to create this application where I need to create a panel with different buttons. I can select a button and drag a button on to a canvas. Can anyone tell me how to create a dragging button.

Member Avatar
Member Avatar
+0 forum 2

I dont know what goes wrong in this code... Help me here I simply want to save the initial and final positions after dragging the mouse... #include"iostream" #include<glut.h> class point1 { public: point1() { x=0; y=0; } int x; int y; }p[2]; int flag=0; void processMouse(int button, int state, int x, int y); void actmot(int x, int y); int main() { //glClear(GL_COLOR_BUFFER_BIT || GL_DEPTH_BUFFER_BIT); glutMouseFunc(processMouse); glutMotionFunc(actmot); glutMainLoop(); return 0; } void processMouse(int button, int state, int x, int y) { if(button==GLUT_LEFT_BUTTON && state==GLUT_DOWN) { if(flag!=1) { flag=1; p[0].x=x; p[0].y=y; } } else if(button==GLUT_LEFT_BUTTON && state==GLUT_UP) { if (flag==1) { p[1].x=x; …

Member Avatar
Member Avatar
+0 forum 3

Hi, Do you have any useful explanation of how to create a draggable window? What I wish to say is when you select your window will have no border ( considering that, it cannot be dragged around screen), how to make it draggable, for example by making a certain area in window "sensible" so after user presses that area and moves cursor, it moves window too? I can't remember best, but I think I saw a tutorial on VB about this problem, and he added a panel writing to it some code and making it "sensible" to dragging. Thank you.

Member Avatar
Member Avatar
+0 forum 1

Hello. I've been using NetBeans for quite a while, and I really like the Draggable components that it uses. In both the GUI Builder & the GUI itself. So, my question is, How do you drag components around in the UI like that? I've looked into the java.awt.dnd package, and the tutorials don't really cover component dragging, just text dragging. If anyone has any tips or links to good tutorials, those would be awesome =).

Member Avatar
Member Avatar
+0 forum 2

The End.