1. Creating custom drag and drop objects in Java with netbeans stackoverflow.comI want to create a frame with a blank area where custom components can be dragged onto and connected, sort of like this. But instead of click to create, I'd ... |
2. Problem in dragging an object. coderanch.comI have drawn a group of rectangles, i want to move and place it in a new place by draggging it. But it couldn't able to move it. Paint method protected void paintComponent(Graphics g) { super.paintComponent(g); g.create(); Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); g2.setColor(getBackground()); setBackground(Color.WHITE); drawPanel(g2); drawCalendar(g2); drawEquipment(g2); } // method for drawing rectangles void drawEquipment(Graphics g) { Graphics2D g2 = (Graphics2D)g; ... |