Drag And Drop Using Robot Class

Jun 4, 2014

Is it possible to do drag and drop using robot class instead of using TransferHandler class?

View Replies


ADVERTISEMENT

JSP :: Drag And Drop Form Fields

Feb 28, 2014

I have a web application. I want to generate the UI part(basically html/jsp pages) to be generated dynamically using drag and drop of elements.So is there is any way that I can:

1: Have drag and drop of elements in jsps?
2: How I can create and store back the form attributes dynamically?

View Replies View Related

Move Object During Drag And Drop

Jan 23, 2014

I am just trying to understand during a drag and drop how can I transfer the actual object instead of just creating a new one. I believe I am close but I cannot nail down where I am going wrong. Here is my code I am using to test this.

First/Main:

Java Code:

package main;
import javax.swing.SwingUtilities;
public class Main {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable(){

[Code] ......

When I drag the JPanels it just copies and makes a new one. I tested this by having a sysout send to the console a private int that I set during the initial creation of the object.

View Replies View Related

JavaFX 2.0 :: Drag And Drop TilePane

Jan 27, 2015

Any example of a drag and drop tilePanel with VBox as the children? Basically we would like to reorder the list based on user dragging a VBOX.

View Replies View Related

Drag N Drop MP3 File Using JFilechooser To JTable

Jan 21, 2014

including Drag n Drop a mp3 file using jFilechooser to jTable

View Replies View Related

Drag And Drop Word To Match Image

Feb 13, 2014

Any tips or any way?

View Replies View Related

JSP :: Drag And Drop Images (single Or Multiple) To Upload

May 12, 2014

I am working on a piece of a code - drag multiple files from local window and drop it into a DIV in my application. And then I want to bind the file into Struts which is where I am having issues right now, snippet below :

<form id="upload" action="http://localhost:8080/XXX/xxx.page" method="POST" enctype="multipart/form-data">
<fieldset>
<legend>HTML File Upload</legend>
<input type="hidden" id="MAX_FILE_SIZE" name="MAX_FILE_SIZE" value="300000" />

[Code] ...

Is it an issue when I give the inputType name as userImage?

View Replies View Related

Swing/AWT/SWT :: How To Use JTable Drag And Drop From Netbeans Palette

May 3, 2014

I am still learning how to perfectly use the netbeans palette. I just created a GUI and want to use jTable on it. I have also dragged and dropped jTable component on my GUI. What should I do thereafter? My aim is to allow user input figures into cells, sum up the figures and enter same into a database. I have not used jTable before in java.

View Replies View Related

Swing/AWT/SWT :: How To Drag And Drop Component Within Layout Manager

May 28, 2014

For example, say I have I BoxLayout with a few JButtons in it. How could I make it such that I could drag a JButton such that it could be in front or behind the others?

I've thought about using ComponentMover and just switching to a null layout right before moving it and switch it back right after like bellow, but I'm not sure how to make it keep the change in order.

import java.awt.LayoutManager;
import java.awt.event.MouseEvent;
public class LayoutComponentMover extends ComponentMover
{
private LayoutManager layout;

[code]....

View Replies View Related

Possible To Drag And Drop Controls From DB To Form Design In Netbeans

Feb 6, 2014

Is it possible to "drag & drop" controls from a db to the form design in Netbeans? InVB this is possible. How about Java - Netbeans?

View Replies View Related

JavaFX 2.0 :: TreeView - Performing Drag / Drop With No Selection

Jul 14, 2014

How do I keep an item (TreeItem) from being selected when performing a drag -n- drop? I don't want it to be selected because it will end up making the target disappear (selection of TreeItem changes target panel).
 
Related question: Is there a way to "veto" a tree selection change as well?

View Replies View Related

Swing/AWT/SWT :: JTree - Drag And Drop Inside One Tree - Java 1.6

Jul 16, 2008

I am trying to drag and drop tree nodes within the same JTree. I have a code which uses Java 1.2 java.awt.dnd.I would like to use TransferHandler and newer implementation.I have found a code which works when JTree is drop target but there is no code where Jtree is drag source and drop target.

View Replies View Related

Passing File Path To Servlet Using Drag And Drop Method In Java Web

Jun 18, 2014

currently I am doing my java web application project ,and it has following steps 1) Upload the txt files 2) java servlet gets the txt file's url , read the data and do the calculation 3) pass the results

I almost finished the second step , and working on the first step .Since there are so many input files at a given time , i have to use drag and drop method to get the file's location.how to pass file's path to servlet.( servlet code can read the data from the given txt file path )software used - tomcat and netbeans 8.0

View Replies View Related

How To Make Robot Print Out Colons

May 1, 2014

I've tried making my robot print out colons but I just can't seem to. I tried doing

Java Code:
robot.keyPress(KeyEvent.VK_COLON); mh_sh_highlight_all('java');

and

ava Code:
robot.keyPress(KeyEvent.VK_SHIFT);
robot.keyPress(KeyEvent.VK_SEMICOLON); mh_sh_highlight_all('java');

And neither seem to work, in fact I can't seem to get any symbols typed out (I don't want to copy to clipboard and paste out) (yes, I do keyRelease as well -> I've tried a bunch of stuff)...

View Replies View Related

Coding A Robot To Follow A Line In Eclipse?

Mar 11, 2014

I have a serious issue with getting this robot to follow a line?

View Replies View Related

How To Make Resizable Screencapture Using Robot In Java

May 9, 2015

I am new to java. I am trying to make a simple screencapture and display program.

I am using robot class to capture a particular portion of the screen and display it in a separate frame.

However I need to be able to resize the area of screencapture. I searched but I dint find any solution wherein I can do so.

I am using this command for capturing the screen

But I couldn't find a way to make the rectangle re-sizable.

Java Code:

BufferedImage buff = robot.createScreenCapture(new Rectangle(0,0,1300,750)); // x-coord, y-coord, width, height mh_sh_highlight_all('java');

View Replies View Related

Program To Simulate Operation Of Simple Robot

Apr 26, 2015

Write a program to simulate the operation of a simple robot. The robot moves in four directions: Forward, backwawrd, left, and right. The job of the robot is to move items and place it in the right slots in each station. There are 8 stations plus the pickup station. Pick up station is the initial start where the robot picks the items. 8 items can be placed on each station. The nearest station must be filled before placing items on the next station. The items are marked with identification or serial numbers. The items with odd serial number go to the right and items with even number go to the eft. The last slot, number 7 is reserved for light items which are less than 80kg. The serial number is a five digit number, the MSB digit 5 indicates that the product must be placed in the fifth station which is keeping the product at 20 degree F.

View Replies View Related

Designing A Game That Simulates Roomba Robot Vacuum

Feb 14, 2014

I am designing a game that simulates a roomba robot vacuum and have most of the framework done. So I have random floating circles and the Roomba bot in the center. The boot is suppose to move with the arrow keys. However when i run the program and select the keys nothing happens. Here's my code.

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.Ellipse2D;
import java.awt.Graphics;
import javax.swing.*;
public class Roomba extends JFrame implements ActionListener, KeyListener{
 
[Code] .....

View Replies View Related

How To Drag JLabel Correctly Across JFrame

May 26, 2014

I am currently trying to make a method that will enable a jLabel to be dragged across the screen. I want to be able to drag the object pretty much anywhere on the screen(I hope to eventually make a destination for it where it can be dropped but I will get to that later). I have looked on various places on the internet on how to achieve this and the most simple solution does something like this:

Java Code:

jLabel6.setText("jLabel6");
jLabel6.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
public void mouseDragged(java.awt.event.MouseEvent evt) {
jLabel6MouseMoved(evt);
}
});
private void jLabel6MouseDragged(java.awt.event.MouseEvent evt) {
x = evt.getX();

[Code]...

This actually works somewhat but it is very faulty. For example the jLabel keeps appearing and reappearing as I drag it. Furthermore when I drag it I can see a duplicate Jlabel being dragged as well in the top left hand screen. So how might I fix this?

View Replies View Related

JSP :: Selected Drop Down Menu?

Nov 8, 2014

I am making an edit page and I want to populate my drop down menu with things that were already selected. For example, if i want i click to edit my favorite food it will be populated with the one the user previously selected. How do i go about doing this? [URL] ....

View Replies View Related

JSP :: Dynamically Populate Drop Down List?

Dec 2, 2014

I'm having an issue with populating a dropdown list in my HTML form.

I want the form to pull in the values from the Database. I have a connection and I'm able to populate a table with the values.

Now I'm trying to populate a dropdown within a form that will bring in currency codes that are in a column called CURR_CODE from the Database.

<%
//Declare variables
//String con_currency_sdo = ""; // as New Connection
String ResultSet = "rs"; // as New Command
String Statement = "stmt"; // as New Recordset
String selBaseCurr = request.getParameter("CURR_CODE");

[code]....

View Replies View Related

Calculating Number Through 4 Drop Down Menus

Jan 5, 2015

How to calculate an outcome/number through a combination of 4 drop down menus (drop down menu's 1 and 2 combine to form a specific value and menu's 3 and 4 combine to form a specific value), example ;

1st drop down menu (1*) = a,b,c,d,e
2nd drop down menu (2*) = 5,4,3,2,1
3rd drop down menu (3*)= a,b,c,d,e
4th drop down menu (4*)= 5,4,3,2,1

Example of drop down menu layout - [URL] ....

a->e = low to high (value) predominant value so b5>a1 ; d5>c1
5->1 = low to high (value)

Then the calculation involves the 1st and 2nd menu to form 1 value, so c3, e4 etc and the 3rd and 4th menu unite to form 1 value that is different from the first; c2, e3

So (1*2*) b3 ; (3*4*) b1 = x value

Also the value from 1*2* menu must be lower than value from menu 3*4*; so you cannot input 1*2* c4 ; 3*4* c5 /or b1 (so once the first menu is selected, the 3rd and 4th menu's wont show anything lower)...

View Replies View Related

JavaFX 2.0 :: How To Enable Multiselection In TableView Via Mouse Drag

Jun 11, 2014

I have multiselection working in my TableView but only via shift-click or using the keyboard but how do I enable the selection of several table rows via a mouse drag? It does not seem to work out of the box.

View Replies View Related

JavaFX 2.0 :: Drag Events Destroyed By Window Resize?

Jan 24, 2015

I've been having great success developing a drag-drop component for a JavaFX app, but I've run into an issue that has me completely stumped.
 
Specifically, I create a component that can be dragged around inside an anchor pane.  That anchorpane is nested in a split pane, which is nested in another anchor pane (the control's root element).
 
The issue can be described this way:
 
Case #1:  If I start the application as a small window, I can reposition the control by dragging it around the screen as I please.
Case #2: If I start the application and maximize the window, again, I can drag the control around the screen as I please.
Case #3: If I start the application, drag the control around a bit, then resize the window, the drag event handling breaks as follows:

1.  The control drag events will fire normally only within the bounds of the anchor pane's previous size.
2.  The mouse cursor's drag icon changes as I pass in or out of those bounds
 
I'm absolutely certain the anchorpane is resizing to match the parent window, otherwise Case #2 would not succeed.  I'm at a complete loss as to determine why the drag events don't fire within the bounds of the resized window after they've been fired within the bounds of it's previous size.
 
Understand the mechanism I'm using to establish the drag handling:  Once the controller is instantiated and added to the scene, an event listener on the class's parentProperty fires to attach the drag event handling to the parent node.
 
Previously, I was setting / clearing the drag handling on the parent node in the drag detection / drag dropped event handlers.  I had suspected that adding / removing drag events was causing the trouble and opted for this solution to ensure that the same event instance was being used each time.  Both methods have had the same result.
 
If you want to see the UI in action, here's a youtube link (it does not demonstrate the problem I'm having):
 
[URL]
 
Here's the code that I'm using, redacted for clarity:
 
public class FileSystemNode extends AnchorPane {
@FXML private AnchorPane fs_node_title;
private FileSystemType mFsType;
private Point2D mDragPoint;

[Code]....

View Replies View Related

JSP :: Form That Has A Drop Down Option For A User To Select

May 28, 2014

I have a jsp form that has a drop down option for a user to select. I would like to know how to have a pre-selected option that has been retrieved from my database or provide a default option if none has been selected by the user. My form allows a user to update a record in my database and what I need to achieve is when a user is updating an existing record they do not have to touch the drop down box if the do not need to change that option.

Here is my current form below form method

="POST" action='UserController?action=edit&albumId=${album.albumId}' name="frmAddAlbum">
<label for="album id">Format : </label>
<select name="action" selected=<c:out value="${album.format}" /> >
<option value="listUser">CD</option>
<option value="listUser">Tape</option>
<option value="listUser">MP3</option>
<option value="listUser">VINYL</option>
</select>

[code]....

View Replies View Related

Swing/AWT/SWT :: StartDrag Method Call - Drag Image Is Not Ready

Oct 15, 2013

Ok so to learn Dnd image ability a little further I created a simple drag and drop application trying to use an external image when trying to drag and drop. Unfortunately I am still getting errors during the startDrag method call. This is the error message it gives "java.awt.dnd.InvalidDnDOperationException: drag image creation problem: drag image is not ready"

The code is as follows:

package com.Test;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;

[Code] ....

The code the error happens on is:

public void dragGestureRecognized(DragGestureEvent e) {
System.out.println("Drag Started!" + e.getComponent().toString());
//BufferedImage img = (BufferedImage) this.createImage(this.getWidth(), this.getHeight());
//BufferedImage img = (BufferedImage) Toolkit.getDefaultToolkit().getImage("Happy.jpg");
//if (!(img == null)){
//System.out.println("Image is not null!");
//}
Image img2 = Toolkit.getDefaultToolkit().getImage("C:1Happy.PNG");
e.startDrag(getCursor(), img2, new Point(0,0), this, this); //This is where the error is
}

I see the text Drag Started in my console with the sysout line but it will not show the image I am trying to use during the drag operation.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved