Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

amit ofer

@amit ofer
About
Posts
4
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Swing JDialog bug? [modified]
    A amit ofer

    hi, I'm trying to create my own dialog by extending the JDialog class this is the code i used to start:

    import javax.swing.JDialog;

    public class ColorManager extends JDialog{

    private static final long serialVersionUID = 1L;
    public ColorManager(){
        super();
    this.setDefaultCloseOperation(JDialog.DISPOSE\_ON\_CLOSE);
        this.pack();
        this.setVisible(true);
    	
    }
    

    }

    when i try to run the code it works fine but i'm getting the following exception: Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE i read that there were problems with WINDOWS_EXIT or something like that but the parameter i pass should do the job. the thing that makes it even weirder is that when i change my class so it will contain a JDialog field instead of extending it, it seems to work just fine. I asked a friend to test this on his computer and the code did not throw the exception, he is using jre version 1.6.022 and I'm using 1.6.022 both of us are using 64 bit. so what did i do wrong? or is that a bug in the JRE? thank, Amit ofer Edit: forgot to mention, I'm using eclipse Edit2: i tried the same code in Netbeans and it works fine, what could be my problem??

    modified on Saturday, March 26, 2011 7:12 AM

    Java help java question announcement career

  • color fade animation for grid cells in swing
    A amit ofer

    hi, I'm doing a path-finding project as part of my 4th year software engineering degree. we're suppose to give visual representation to a bunch of multi-agent pathfinding algorithm. the simplest one is A* adapted for multiagents. anyway our environment is a grid map where every cell can be either blocked or used as part of an agent's path. what i wanna do is use animation to give a good representation of the final movement of the agent, but animating color change in my grid. i.e paint every step in the path for a second or so with some color to show how the agent moves. and the other thing i wanna do is to represent the way the algorithm works by painting the changes in the open list and closed list of the A* algorithm while its doing its calculation. I'm using an adapted version of the observer design pattern to send events from my algorithm layer to my controller and gui layer. what i wanna do in the gui layer is everytime a tile is added to the open list, i want to have that cell painted in some color and then have it fade away according to a predefined timer or maybe later add a slider to control this timer. I looked at the code here: http://www.java2s.com/Code/Java/2D-Graphics-GUI/Colorfadinganimation.htm. it seems pretty simple, the problem is that every tile animation has to be independent of the others to allow the algorithm and everything to keep running and different animations to start. so whats the best way to achieve the results i'm looking for? should i just open a different thread for each animation or have a pre-made thread for each cell. would that be an over kill for the application, since there can be up to 1000 cells and therfore close to 1000 threads performing animation. another issue i think i might encounter is the fact that it might happen that a cell will start its color fading animation and then will have to restart and i don't want the two animations to go at the same time (only one thread performing animation for the same cell at the same time). I hope i was clear enough with what i'm trying to achieve, if someone has any ideas or thought it could really help me with my project. thanks in advanced Amit Ofer

    Java help agentic-ai java css com

  • integrating a Map and GIS in a java path finding simulator
    A amit ofer

    The problem with Google Maps is that i'm not sure that it provides me with the roads data. i think it only allows to add a viewable map to my application. what i need is to be able to get the data so i can provide it to my algorithm as input. I think that what i'm looking for is called a vector map. (so i can represent the roads as a directed graph)

    Java agentic-ai java css algorithms json

  • integrating a Map and GIS in a java path finding simulator
    A amit ofer

    hi, my name is Amit and I'm a software engineering student in Ben Gurion university in Israel. I've recently started working on my final project which is a simulator application for multi-agent path-finding algorithms. the main idea of my project is to be able to test a few pathfinding algorithms (A* for example) on two different environments. the first is a grid map which is quite simple to implement. the second which is the reason i'm here is map, or more precisely a road map. each agent in the search algorithm will be represented by a car on the road map where the point is to see the movement of the cars from their starting position to their destination without any collisions between the cars. so what i need is a way to integrate a road map inside my Java Swing application and be able to draw stuff on the map and get the coordinates for the roads in the map as an input to my search algorithm. i thought about using google maps for this, as i am a huge fan of google and i thought that the API will be simple and easy to use. before i jump into studying the google maps API i wanted to make sure that its what i'm looking for and what i wanna do can be done using google maps. i don't want to start with google maps API and in the middle of the project find out that its not right for the task and have to throw everything. i also thought about using Google earth, but i think 2d maps will be easier to handle and should be good enough for what i wanna accomplish. so are the things i mentioned possible/not to hard to accomplish using Google Maps API or should i search for alternative? thanks Amit Ofer

    Java agentic-ai java css algorithms json
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups