Search Results

Search found 1571 results on 63 pages for 'swing'.

Page 49/63 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • GWT now has spring roo support, what will this mean to GWT developers?

    - by Mark M
    I have been using GWT with App Engine for a while now. Recently there was an announcement that GWT will support Spring Roo and SpringSource Tool Suite (http://googlewebtoolkit.blogspot.com/2010/05/gwt-21-milestone-1-is-now-available.html). I am having trouble seeing the big picture from the Google announcement page. For those without much knowledge of Spring what does this mean for GWT developers used to building swing-like gui's?

    Read the article

  • apache derby database

    - by mohit
    i am building a swing application with apache derby database as back end in netbeans 6.8 with my friend.He is making the databse in derby while i am making the front end i.e. frames. now how do i use database created by him in my project in netbeans 6.8 my motive is to how we insert a already build databse(from my friend's netbeans) into the the services tab of my application.

    Read the article

  • I'm tired of JButtons, how can I make a nicer GUI in java ?

    - by Jules Olléon
    So far I've only build "small" graphical applications, using swing and JComponents as I learned at school. Yet I can't bear ugly JButtons anymore. I've tried to play with the different JButton methods, like changing colors, putting icons etc. but I'm still not satisfied. How do you make a nicer GUI in java ? I'm looking for not-too-heavy alternatives (like, without big frameworks or too complicated libraries).

    Read the article

  • Split a complex GUI window into several files in Netbeans

    - by Hectoret
    After building the application GUI, I realised it was a little bit too complex and I could reuse some of the Swing components. The result is a complex class with many anidated JPanels. My question is: does Netbeans provide a way to split a JPanel and its children components into a different class? If I do it by hand, will the GUI designer still work? Thanks!

    Read the article

  • What is the exact rule of jQuery's animate() parameters?

    - by Jian Lin
    jQuery 1.4.2's animate() API spec is .animate( properties, [ duration ], [ easing ], [ callback ] ) but it seems that we can supply duration, callback, and no easing .animate({left: '+= 100'}, 600, doThis) and it will work. But if we supply easing and callback and no duration .animate({left: '+=100'}, 'swing', doThis) then the easing won't be taken into effect. So what exactly is the API supposed to be?

    Read the article

  • How to launch java application from Dock, Mac

    - by Sunil Kumar Sahoo
    I have created a Java Swing application. It works fine. I have created application file (.app) for that application using jar bundler. But the main problem is that my application does not open if I click it on the Dock. I am using Mac OS. How I can launch my application by clicking on Dock Thanks Sunil Kumar Sahoo

    Read the article

  • Read / write program in java using JChooser

    - by Casper Marcussen
    Hello everyone Didn't want to bother people in here, but since i am under a time pressure, i am desperate to get help. My questions is how to link the file choosen from a JChooser to a file, and how to converte it to stringm being able to display and edit it in a TextArea. i hav ethe GUI set up using swing, but the link between actionListener and the Jchooser is not complete Any help would be much appreciated code: http://pastebin.com/p3fb17Wi

    Read the article

  • What is the wrong of this converted code?

    - by Gum Slashy
    I'm developing shape identification project using javacv and I have found some opencv code to identify U shapes in particular image and I have try to convert it in to javacv but it doesn't provide same out put. Can you please help me to convert this opencv code into javacv? This is Opencv code import cv2 import numpy as np img = cv2.imread('sofud.jpg') gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) ret,thresh = cv2.threshold(gray,127,255,1) contours,hierarchy = cv2.findContours(thresh,cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE) for cnt in contours: x,y,w,h = cv2.boundingRect(cnt) if 10 < w/float(h) or w/float(h) < 0.1: cv2.rectangle(img,(x,y),(x+w,y+h),(0,0,255),2) cv2.imshow('res',img) cv2.waitKey(0) cv2.destroyAllWindows() This is the expected output This is the code that I have converted import com.googlecode.javacpp.Loader; import com.googlecode.javacv.CanvasFrame; import static com.googlecode.javacpp.Loader.*; import static com.googlecode.javacv.cpp.opencv_core.*; import static com.googlecode.javacv.cpp.opencv_imgproc.*; import static com.googlecode.javacv.cpp.opencv_highgui.*; import java.io.File; import javax.swing.JFileChooser; public class TestBeam { public static void main(String[] args) { CvMemStorage storage=CvMemStorage.create(); CvSeq squares = new CvContour(); squares = cvCreateSeq(0, sizeof(CvContour.class), sizeof(CvSeq.class), storage); JFileChooser f=new JFileChooser(); int result=f.showOpenDialog(f);//show dialog box to choose files File myfile=null; String path=""; if(result==0){ myfile=f.getSelectedFile();//selected file taken to myfile path=myfile.getAbsolutePath();//get the path of the file } IplImage src = cvLoadImage(path);//hear path is actual path to image IplImage grayImage = IplImage.create(src.width(), src.height(), IPL_DEPTH_8U, 1); cvCvtColor(src, grayImage, CV_RGB2GRAY); cvThreshold(grayImage, grayImage, 127, 255, CV_THRESH_BINARY); CvSeq cvSeq=new CvSeq(); CvMemStorage memory=CvMemStorage.create(); cvFindContours(grayImage, memory, cvSeq, Loader.sizeof(CvContour.class), CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE); System.out.println(cvSeq.total()); for (int i = 0; i < cvSeq.total(); i++) { CvRect rect=cvBoundingRect(cvSeq, i); int x=rect.x(),y=rect.y(),h=rect.height(),w=rect.width(); if (10 < (w/h) || (w/h) < 0.1){ cvRectangle(src, cvPoint(x, y), cvPoint(x+w, y+h), CvScalar.RED, 1, CV_AA, 0); //cvSeqPush(squares, rect); } } CanvasFrame cnvs=new CanvasFrame("Beam"); cnvs.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); cnvs.showImage(src); //cvShowImage("Final ", src); } } This is the out put that I got please can some one help me to solve this problem ?

    Read the article

  • Ladder word-like game GUI problems

    - by sasquatch90
    Ok so I've written my own version of game which should look like this : http://img199.imageshack.us/img199/6859/lab9a.jpg but mine looks like that : http://img444.imageshack.us/img444/7671/98921674.jpg How can I fix this ? Is there a way to do the layout completely differently ? Here's the code : Main.java : import java.util.Scanner; import javax.swing.*; import java.awt.*; public class Main { public static void main(String[] args){ final JFrame f = new JFrame("Ladder Game"); Scanner sc = new Scanner(System.in); System.out.println("Creating game data..."); System.out.println("Height: "); while (!sc.hasNextInt()) { System.out.println("int, please!"); sc.next(); } final int height = sc.nextInt(); Grid[]game = new Grid[height]; for(int L = 0; L < height; L++){ Grid row = null; int i = L+1; String s; do { System.out.println("Length "+i+", please!"); s = sc.next(); } while (s.length() != i); Element[] line = new Element[s.length()]; Element single = null; String[] temp = null; String[] temp2 = new String[s.length()]; temp = s.split(""); for( int j = temp2.length; j>0; j--){ temp2[j-1] = temp[j]; } for (int k = 0 ; k < temp2.length ; k++) { if( k == 0 ){ single = new Element(temp2[k], 2); } else{ single = new Element(temp2[k], 1); } line[k] = single; } row = new Grid(line); game[L] = row; } //############################################ //THE GAME STARTS HERE //############################################ JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.setBackground(Color.ORANGE); panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); for(int i = 0; i < game.length; i++){ panel.add(game[i].create()); } f.setContentPane(panel); f.pack(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); boolean end = false; boolean word = false; String tekst; while( !end ){ while( !word ){ tekst = JOptionPane.showInputDialog("Input word: "); for(int i = 0; i< game.length; i++){ if(game[i].equalLength(tekst)){ if(game[i].equalValue(tekst)){ word = true; for(int j = 0; j< game.length; j++){ game[i].repaint(); } } } } } word = false; for(int i = 0; i < game.length; i++){ if(game[i].solved()){ end = true; } else { end = false; } } } } } Grid.java import javax.swing.*; import java.awt.*; public class Grid extends JPanel{ private Element[]e; private Grid[]g; public Grid(){} public Grid( Element[]elements ){ e = new Element[elements.length]; for(int i=0; i< e.length; i++){ e[i] = elements[i]; } } public Grid(Grid[]grid){ g = new Grid[grid.length]; for(int i=0; i<g.length; i++){ g[i] = grid[i]; } Dimension d = new Dimension(600, 600); setMinimumSize(d); setPreferredSize(new Dimension(d)); setMaximumSize(d); } public JPanel create(){ JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); panel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); for(int j = 0; j < e.length; j++){ panel.add(e[j].paint()); } return panel; } @Override public void repaint(){ } public boolean equalLength(String s){ int len = s.length(); boolean equal = false; for(int j = 0; j < e.length; j++){ if(e.length == len){ equal = true; } } return equal; } public boolean equalValue(String s){ int len = s.length(); boolean equal = false; String[] temp = null; String[] temp2 = new String[len]; temp = s.split(""); for( int j = len; j>0; j--){ temp2[j-1] = temp[j]; } for(int j = 0; j < e.length; j++){ if( e[j].letter().equals(temp2[j]) ){ equal = true; } else { equal = false; } } if(equal){ for(int i = 0; i < e.length; i++){ e[i].changeState(3); } } return equal; } public boolean solved(){ boolean solved = false; for(int j = 0; j < e.length; j++){ if(e[j].getState() == 3){ solved = true; } else { solved = false; } } return solved; } @Override public String toString(){ return ""; } } Element.java import javax.swing.*; import java.awt.*; public class Element { final int INVISIBLE = 0; final int EMPTY = 1; final int FIRST_LETTER = 2; final int OTHER_LETTER = 3; private int state; private String letter; public Element(){ } //empty block public Element(int state){ this("", 0); } //filled block public Element(String s, int state){ this.state = state; this.letter = s; } public JButton paint(){ JButton button = null; if( state == EMPTY ){ button = new JButton(""); button.setBackground(Color.WHITE); } else if ( state == FIRST_LETTER ){ button = new JButton(letter); button.setBackground(Color.red); } else { button = new JButton(letter); button.setBackground(Color.yellow); } button.setSize(20,20); return button; } public void changeState(int s){ state = s; } public String letter(){ return letter; } public int getState(){ return state; } @Override public String toString(){ return "["+letter+"]"; } }

    Read the article

  • java classcast exception

    - by shil
    hi i have problems in converting an XML document type into a Document object.. this is the piece of code line 1 : Document doc=null; line 2 : doc = (Document) parser.parse(sourceFile); for this line 2 it throws java classcast exception.. without the typecast it shows error as "Type mismatch: cannot convert from org.w3c.dom.Document to javax.swing.text.Document" how do i now typecast properly? any suggestions??

    Read the article

  • 2d java Graphics

    - by LukeG
    I am new to java 2d graphics and I have problem handling mouseclick event. Is it possible for you to tell me why there is nothing going on after updating mouse status to clicked ? What I want to do is to change the image in array at 0 2 to another image. Nothing happens tho. Thanks for your help in advance. import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.event.*; import java.awt.*; import javax.swing.ImageIcon; import javax.swing.*; public class Board extends JPanel implements MouseListener { private static boolean[] keyboardState = new boolean[525]; private static boolean[] mouseState = new boolean[3]; private static Image[][] images; Image house; int w = 0; int h = 0; int xPos; int yPos; ImageIcon ii = new ImageIcon(this.getClass().getResource("house.gif")); ImageIcon iii = new ImageIcon(this.getClass().getResource("house1.gif")); public Board() { house = ii.getImage(); h = house.getHeight(null); w = house.getWidth(null); images = new Image[10][10]; for(int i = 0; i < 10; i++) { for(int j = 0; j < 10; j++) { images[i][j] = house; } } } public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; for(int i = 0; i < 10; i++) { for(int j = 0; j < 10; j++) { g2d.drawImage(images[i][j],w*i,h*j,null); } } //g2d.drawImage(house,15,15,null); } public void checkMouse() { if(mouseState[0]) { images[0][2] = iii.getImage(); repaint(); super.repaint(); } } @Override public void mousePressed(MouseEvent e) { mouseKeyStatus(e, true); checkMouse(); } @Override public void mouseReleased(MouseEvent e) { mouseKeyStatus(e, false); repaint(); } public static boolean mouseButtonState(int button) { return mouseState[button - 1]; } private void mouseKeyStatus(MouseEvent e, boolean status) { if(e.getButton() == MouseEvent.BUTTON1) mouseState[0] = status; else if(e.getButton() == MouseEvent.BUTTON2) mouseState[1] = status; else if(e.getButton() == MouseEvent.BUTTON3) mouseState[2] = status; }

    Read the article

  • Clean Stack Traces in Groovy using Eclipse?

    - by yar
    I am using Groovy in a Java Swing application as part of my plan to force-feed myself dynamic languages until I like them (which is happening, partly). My stack traces are filled with Groovy stuff like org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor is there a way to get Eclipse to remove all of that codehaus stuff (filter stack traces, basically)? Edit: I can do this from the command-line with grep (well, not yet) so it's not so bad, but inside of Eclipse would be great too.

    Read the article

  • Two loops speeds drawing in a Jframe

    - by noahn567
    I have a program that requires two classes. The player-Names class, and the Player-Model class. I want the player-Names class to repaint every half second, and the Player-Model class to repaint 60 times per second because i want the movement to be smooth. The problem that i am having is that i want all of this to be done on one J-frame. How would i go about doing this? If you could lead me in the right direction or give me a little example that would be great! Thank you :). for some reason it wont let me post so i'm going to put in some random code import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import javax.swing.JComponent; import javax.swing.JFrame; public class PlayerNames extends JFrame { static int connectionTimer = 0; static int connectionTimer2 = 0; static int reconnect = 0; static int reconnectValue = 1; static int x = 0; static int reconnectWait = connectionTimer + reconnectValue; private static final long serialVersionUID = 1L; public graph gg = new graph(); public graph g = new graph(); private static GameClient socketClient; private GameServer socketServer; public static void main(int width, int height) { PlayerNames tt = new PlayerNames(); // PlayerGraphics t = new PlayerGraphics(); tt.setSize(width, height); if (Game.ServerOwner == 1) { tt.setTitle("Server: " + Game.username); } else { tt.setTitle("Username: " + Game.username); } tt.setVisible(true); tt.getContentPane().add(tt.gg); tt.getContentPane().add(tt.g); tt.setDefaultCloseOperation(EXIT_ON_CLOSE); tt.setResizable(false); }

    Read the article

  • How Netbeans Editors know that file is not modified after undo?

    - by Ha
    Netbeans uses standart UndoManager API for implementation of undo functionality. But neither standart javax.swing.undo.UndoManager nor org.openide.awt.UndoRedo.Manager doesn't have any method to mark states as saved and check modified status. Nonetheless if you change the file and press undo, the file is marked as unmodified. How do they do that? I need the same functionality for my (non-text) editors if the Netbeans RCP application.

    Read the article

  • Java Object Creation Error

    - by ikurtz
    package Sartre.Connect4; import javax.swing.*; public class ChatGUI extends JDialog { public ChatGUI(){ setTitle("Chat"); } } when i do this in another class in the same package: ChatGUI chatGUI = new ChatGUI(); i end up with a situation: Cannot Find Symbol please help?

    Read the article

  • How to activate and deactivate frame in java?

    - by Nitz
    hey guys I had made one application in java-swing, Now what i am getting problem is, i want to minimize my jframe when it is deactivate and then to maximize i want to activate that window. So for maximize, i want to activate any jframe using java code. So how to activate and deactivate any jframe, so that i can do something on window listeners? thanks in advance.

    Read the article

  • Lightweight Java reporting engine

    - by tuler
    I'm looking for a lightweight java reporting engine to be embedded in an applet application. My first option was Jasper Reports, but the jar is over 2Mb, a little too heavy (and too bloated) for my needs. I don't know if there is modular jasper distribution, with funcionalities split in several jars (like html rendering, pdf, excel, compilation, runtime, etc). I need to preview the report using Swing and print it. PDF export is a plus.

    Read the article

  • Implementing hoverIntent for Drop Down Menu (coming from click_event)

    - by stormeTrooper
    I've just recently started programming, I was hoping for some help. I have a drop down menu that was originally activated by click_event, however I want to now implement hoverIntent in order to make the menu drop. The issue I am having now is being able to use the menu, because whenever I invoke the menu now, once I leave the area that activates the menu, the menu closes. If you could explain to me like I'm five, I'd appreciate it, thanks :) The code I am using as follows: JavaScript: function setupUserConfigMenu() { $('.user_profile_btn').hoverIntent( function (event) { $('#user_settings_dropdown').animate({height:['toggle', 'swing'] }, 225); }, function (event) { $('#user_settings_dropdown').animate({height:['toggle', 'swing'] }, 225); }) } HTML: <li> <a href="<%= "#" %>" class="user_profile_btn" title="Your profile page"><%= truncate(current_user.full_name || current_user.name, :length => 28) %> <div class="arrow_down"></div></a> <ul id="user_settings_dropdown"> <li> <a href="<%= current_user.get_url(true) %>"> <%= image_tag current_user.get_thumb_url, :size => "30x30" %> <div> <%= truncate(current_user.full_name || current_user.name, :length => 40) %> <br> View profile </div> </a> </li> <div class="grey_line"></div> <li class="settings_list_item"> <%= link_to "Settings", edit_user_registration_path %> </li> <li class="settings_list_item"> <%= link_to "About", "/about" %> </li> <li class="settings_list_item"> <%= link_to "Logout", destroy_user_session_path, :method => :delete %> </li> </ul> </li>

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >