Narayan Gopal Maharjan is a 22 years old software developer, living in the Kathmandu, Nepal and currently under-graduating on software engineering.He has keen interest at Java and Javafx programming , he started programming from his high school age and he develops software on Web(JavaEE), Desktop(Java Swing,Java FX), Mobile(Android) devices.
He loves java most cuz it is cross platform programming language . It can be run on any platform
Learn, Explore and Grab it !!
-Narayan Gopal Maharjan
Touch Me:
Great site. Keep doing.
Very interesting site. Hope it will always be alive!
tTWwJv Excellent article, I will take note. Many thanks for the story!
like quit interesting yar keep going yar …..
Hello,
I need help…
How alignment a textbox to right in javafx 2.0 ?
Hello
I am having trouble getting JavaFX to work in my browser. Due to this reason I can not view the demos on this website. I have tried to install the JavaFX platform multiple times using all possible combination but the deployment on browser fails. Can you please provide a brief tutorial regarding deploying/installing JavaFX so that the apps can be run in browsers?
THanks
Please let me know which javafx version are yout taking about? If it’s javafx 1.3 then then the deployment tutorial is in this blog you can search them. But for javafx 2.0 the deployment is very buggy till now. You can run the javafx2 in browser but it’s really awkward. So please be patient for the next stable release of javafx 2.0 .
Nice Site… Keep on going…
Help Me!!!
[email protected]
Great work with excellent explanation, thumbs up for you~
Looking forward MORE from you~
I’ll be back on Feb may be due to lot’s of works. Thanks for thumbs up!! π
Getting inspiration from you brozz………………..Keep it up !!!!!!!!!
Hi Narayan,
Nice blog! Is there an email address I can contact you in private?
For contact email You can see in http://ngopal.com.np . Also I’ve updated the about pages now.
Pingback: FXML communicates to FXML via FXControllers and Interface « Java and FX
Great site, congratulations on blogs and continue this great work.
Genescn
Direct from Brazil
Thanks man !! π
hi narayan bhai, I am from ktm and currently working in US in javafx itself. I landed on your blog, it looks promising. Keep up the great work.
Thanks bro..
Hello! adcekca interesting adcekca site! I’m really like it! Very, very adcekca good!
I have a question for you , my question is
I’m creating a JAVA video player my problem is when i click on maximize button the objects doesn’t maximize only the form maximize. So how can i do it.
Thank you
Ashwin Pathak
You would have better email me on [email protected]
@Ashwin Use layout design.
@Narayan G. Maharjan
sorry i was not knowing your e-mail id but i got it now .. π and thanks for helping.
liked this blog .. π
Hi,
How to add radio buttons in a table view. i am inserting values into tableview from database.
Please help me.
Thanks&Regards
salamat
@salamat,
You can use cell factory to display your custom control on your tablecell.
Great!
Thanks π
i want drap n drop of same button or image multiple times , just like we have drag n drop in rational rose . but this code is working for drag n drop only once , can you help me plz . its very urgent
package ads;
import java.io.File;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.embed.swing.SwingFXUtils;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Cursor;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.ScrollPane;
import javafx.scene.image.ImageView;
import javafx.scene.image.WritableImage;
import javafx.scene.input.*;
import javafx.scene.layout.AnchorPane;
import javafx.scene.text.Text;
import javax.imageio.ImageIO;
public class SampleController1 implements Initializable {
// @FXML
// public Button all[]=new Button[100];
@FXML
public Button entity;
@FXML
public Button attribute;
@FXML
public ScrollPane draw;
@FXML
public AnchorPane test;
Group root = new Group(//
//
);
ImageView[] img={new ImageView(“ads/icons/ent.png”),new ImageView(“ads/icons/att.png”),new ImageView(“ads/icons/rel.png”)};
ImageView[] imgtest=new ImageView[50];
boolean flag=false;
private Node[] children;
//boolean test=false;
@FXML
public void handcursor(MouseEvent event) {
entity.setCursor(Cursor.HAND);
}
/**
*
* @param event
*/
@FXML
public void handleButtonAction(ActionEvent event) {
System.out.println(“You clicked me!dfgfdgdf”);
}
@FXML
public void OnDragDetected(MouseEvent event) {
System.out.println(“onDragDetected”);
Dragboard db = entity.startDragAndDrop(TransferMode.ANY);
ClipboardContent content = new ClipboardContent();
content.putImage(img[0].getImage());
db.setContent(content);
event.consume();
}
@FXML
public void OnDragDetectedPane(MouseEvent event) {
System.out.println(“onDragDetected”);
Dragboard db = entity.startDragAndDrop(TransferMode.ANY);
db.getTransferModes();
ClipboardContent content = new ClipboardContent();
content.putImage(img[0].getImage());
db.setContent(content);
event.consume();
}
@FXML
public void OnDragDone(DragEvent event) {
System.out.println(“onDragDone”);
if (event.getTransferMode() == TransferMode.MOVE) {
System.out.println(“hello”);
}
event.consume();
}
@FXML
public void OnDragDonePane(DragEvent event) {
System.out.println(“onDragDone”);
if (event.getTransferMode() == TransferMode.MOVE) {
System.out.println(“hello”);
}
event.consume();
}
@FXML
public void OnDragDropped(DragEvent event) {
System.out.println(“onDragDropped”);
boolean success = false;
Dragboard db = event.getDragboard();
ClipboardContent content = new ClipboardContent();
if (flag==true) {
//img.setFitHeight(event.getSceneY());
//img.setFitWidth(event.getSceneX());
success=true;
flag=false;
}
event.setDropCompleted(success);
event.consume();
}
@FXML
public void OnDragDroppedPane(DragEvent event) {
System.out.println(“onDragDropped”);
boolean success = false;
Dragboard db = event.getDragboard();
ClipboardContent content = new ClipboardContent();
if (flag==true) {
//img.setFitHeight(event.getSceneY());
//img.setFitWidth(event.getSceneX());
success=true;
flag=false;
}
event.setDropCompleted(success);
event.consume();
}
@FXML
public Button temp;
@FXML
public Text t=new Text(“Hello”);
@FXML
public void OnDragOver(DragEvent event) {
System.out.println(“onDragOver”);
if (event.getGestureSource() != draw
&& event.getDragboard().hasImage()) {
event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
}
Dragboard db = event.getDragboard();
//boolean success = false;
if (db.hasImage()) {
System.out.println(“M in”);
img[0].setLayoutX(event.getX());
img[0].setLayoutY(event.getY());
img[0].setImage(db.getImage());
draw.setContent(img[0]);
flag=true;
//success = true;
}
//event.setDropCompleted(success);
event.consume();
}
public void OnDragOverPane(DragEvent event) {
System.out.println(“onDragOver”);
if (event.getGestureSource() != draw
&& event.getDragboard().hasImage()) {
event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
}
Dragboard db = event.getDragboard();
//boolean success = false;
if (db.hasImage()) {
System.out.println(“M in”);
img[0].setLayoutX(event.getX());
img[0].setLayoutY(event.getY());
img[0].setImage(db.getImage());
draw.setContent(img[0]);
flag=true;
//success = true;
}
WritableImage wim = new WritableImage(300, 250);
img[1].snapshot(null, wim);
File file = new File(“ImageWithEffect.png”);
try {
ImageIO.write(SwingFXUtils.fromFXImage(wim, null), “png”, file);
} catch (Exception s) {
}
//event.setDropCompleted(success);
event.consume();
}
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
}
Hi Raxita,
Seems like you are working with a pre-instanced imageview (i.e. img[0] )everytime. You probably need to create new instance of ImageView if you need it at multiple range.Create one function to generate the instance of imageview so that you get always new π
Thanks
Narayan
Hey , Thank you so much π but can you give me basic idea how do i create new instance everytime ?
Great work and keep on updating …………
in reference to using robot api to take screenshots and then painting them on scene,
i want to capture screen from one system and transmit buffered image or writable image object over network on other system for live telecast like teamviwer, i am using tcp sockets so how can i serialize bufferedimage or writable image so that it could sent these image objects through java.net.socket
It helped me for my notes
Thanks