Software Development
Member Avatar

hi, I am having a problem with adding button on jTable for each data I get from the database.
here is what I get from database in SQLite

 try{ 
     String …
Topic by altjen
  1. about last column ( "Accept/Reject" )
    • how can I reject ??? with simple JButton
    • JOptionPane should be always wrapped into invokeLater - moved to the end of …
Software Development
Member Avatar

Dear Listers,
I have create a project in java using netbeans. Have designed the user interface where I have a jtable and a button.
When i created the interface it …

Topic by vilastadoori
  • for why reason(s) there is/are two arrays, models, ArrayList and DefaultTableModel

  • add records from database to DefaultTableModel directly, then to add model to JTable

  • search for TableFromDatabase, …
Software Development
Member Avatar

I'm curious, when setting the default close operation for JFrames, should you use JFrame's constants or WindowConstants' constants?

As far as I can tell they're the same. Although, IntelliJ (not …

Topic by Doogledude123

there is significant difference WindowListener is designated for add (code block e.g. closing resources before) control the closing JVM processes in comparing with the JFrame.setDefaultClose....

Software Development
Member Avatar

Hi ,
Can anyone point me to fillPolygon source code ,
In Graphics.java it is declared as abstract class .

  • Nataraja G
Topic by nataraja833

my view

  • original Java by Sun was about enthusiasm, tons of API has lack in descriptions (authors of description were inspired by MSDN:-)

  • almost, maybe all methods used …
Software Development
Member Avatar

Hi ,
Can anyone point me to fillPolygon source code ,
In Graphics.java it is declared as abstract class .

  • Nataraja G
Topic by nataraja833

@JamesCherrill wrote - Interesting question. A quick Google doesnt reveal any subclasses for Graphics2d - maybe they are private?,

---> not is available only for its parent - Graphics,

@JamesCherrill …

Software Development
Member Avatar

Hi I am new in java. I am trying to get the stored date in the database and display the same in jdatepicker in frontend. But I failed. Can any …

Topic by Sandeep_13
  • assuming to store value as Date, TimeStampt in database

  • you have to use ResultSet.getDate() instead of little bit crazy parsing and then formatting String instance ...

  • every …
Software Development
Member Avatar

Hi All,
I have a problem in my jdialog(child) and the parent frame is jframe,it is taking two events to close the jdialog,both from the close caption available at the …

Topic by rohtashrathore

crossposted on CodeRanch

Software Development
Member Avatar

I'm trying to show a user JOptionPane where they enter x and y coordinates each in their own textfield, but I don't know how to store user input as ints. …

Topic by Start4me

JOptionPane is designated to returns multiple value from multiple fields two ways as is,

  • primitive array

  • (intialized) variables

in all cases is required to test for (easiest …

Software Development
Member Avatar

i want to get sum of jtable column n that value display in a jtextfield. so what is the code for that?

Topic by Gayan Maduranga
  1. put number to JTable column, better to play with model only

  2. override getColumnClass for correct datatype (String, Double, Date, Icon...)

  3. loop in concrete column by call getValueAt, …
Software Development
Member Avatar

Now am using substance look and feel version 5.3.I want to upgrade the it to latest version 7.2.1. I need to know what is the new features in new version …

Topic by sankubha

I need to know .... new version. ---> no one of Insubstantials members is not here active

Software Development
Member Avatar

I need to fill an image created using a ton of QuadCurves, but they don't fill it all the way using the traditional fill method. Any suggestions?

public class MonstercatComponent …
Topic by pars99

secondary

  • put all graphics objects to the List

  • inside paintComponent loop inside array of Objects

important

  • don't to call anything from paintComponent - GeneralPath mouthAndTeeth = …
Software Development
Member Avatar

I'm making one of those puzzle games that has the empty tile which you need to slide them around to finish the picture. When I refer to the "Active Tile" …

Topic by Doogledude123
  1. override getPrefferedSize instead of hunting for pixels perfections e.g. diff.getWidth()/getHeight();

  2. then inintial calculations about Width/Height is missunderstaning, thats should be part of paintComponent where getWidth()/getHeight() returns real pixels …
Software Development
Member Avatar

I do not know if this will be of use to anyone but i thought i would just leave it here because i saw a thread where someone asked how …

Topic by Stan_1
Software Development
Member Avatar

Hello, I try to rename file or directory using JFileChooser() and JButton(). But it gives me a NullPointer exeption.
I have FileChooser, Button and TextField where I write new name …

Topic by andruluchko

crossposted

Software Development
Member Avatar

I'm painting a grid on the JPanel and trying to scroll the grid with a JScrollPane. I have a feeling the scrollpane is getting the actual size of the panel, …

Topic by Doogledude123

" Does getPreferredSize not return how big you want the component to be in the GUI?"

  • there is only one correct notifier for LayoutManager (for customs too), rest mathods …
Software Development
Member Avatar

I'm painting a grid on the JPanel and trying to scroll the grid with a JScrollPane. I have a feeling the scrollpane is getting the actual size of the panel, …

Topic by Doogledude123

override (based on code posted here)

  • getPreferredSize for GridPanel

  • use getHeight/Weight in paintComponent

  • change scroll increment for JScrollBar for natural scrolling

important everything is elsewhere

Software Development
Member Avatar

So, I've written a Custom Binary Format outline but I'm not sure how to translate it to code. I was looking for a few tips on where to get started? …

Topic by Doogledude123

I was looking for a few tips on where to get started?

  • is possible define MAPDATA as enum

  • depends of design I'm miss there tileCount == U32 and …
Software Development
Member Avatar

Hello im a total noob in java, im learning game development, i made this game and when i thought i was finish i tested in another android with a smaller …

Topic by centenond
  • I'm disagree with java.util.Timer in Java7/8 for AWT/Swing based GUI

  • it could be possible by to call firePropertyChange from java.util.Timer

  • standard is (inaccurate) Swing Timer
Software Development
Member Avatar

Hello im a total noob in java, im learning game development, i made this game and when i thought i was finish i tested in another android with a smaller …

Topic by centenond

quite disagree with @JamesCherrill

  1. for Java animation is to use a java.util.Timer scheduleAtFixedRate == not is about Swing Timer with repaint

or it should be from any more accurate …

Software Development
Member Avatar

Hey everyone! I have to write a program that generates random shapes in a window, but when the window is resized the program can still remember the shapes and redraw …

Topic by compscigirl

JComponents API has implemented repaint() as recrusive method, container is (very extensive) repainted from a few events, notifiers,

  • create final arrays of Object (once time e.g. as local variable) …
Software Development
Member Avatar

Hey everyone! I have to write a program that generates random shapes in a window, but when the window is resized the program can still remember the shapes and redraw …

Topic by compscigirl

but when I resize the window, the shapes change into new ones.

  • talking about resize from container to call repaint(from methods implemented in API), thats correct

  • create an …
Software Development
Member Avatar

Greetings!
I'm reviewing Java, in an effort to enhance my programming skills. I'm utilizing the book "Teach Yourself Java in 21 Days" and I'm currently learning about Java Web Start. …

Topic by TekknoDraykko
Software Development
Member Avatar

I want to remove the first line in jtextpane and setting setContentType("text/html") at the same time.

setContentType("text/html");

Element root = getDocument().getDefaultRootElement();
Element firstLine = root.getElement(0);
getDocument().remove(firstLine.getStartOffset(), firstLine.getEndOffset());

When I use …

Topic by johnny70
  • code (skeleton, logics) is correct,
  • not reason to setContentType("text/html"); at runtime
Software Development
Member Avatar
package filehandling;
import java.awt.event.ActionEvent;
import java.io.*;
import java.awt.*;
import java.awt.event.ActionListener;
import javax.swing.*;

public class Filehandling extends JFrame{
 JTextArea ja;
 JButton jb;
    Filehandling()
 {
 setBounds(400,400,400,400);
 setTitle("azeem");
 setVisible(true);
 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

  Container cont= getContentPane(); …
Topic by haider885

I want to copy TextArea text to a File... == for me (including properties from NativeOS, newline, tab, .....) is JTextArea.write

Software Development
Member Avatar

hey all

I have a program to write and I need to use the JOptionPane dialog box to use JOptionPane to say Yes_No_Option, all I would like to know what …

Topic by divinity02
  • JOptionPane can returns number, date, image, string

  • as is mentioned read API/Oracle tutorial - How to use Dialogs - two-three parts about JOptionPane
Software Development
Member Avatar

I have a JTable that a user can input data. I have an image that I would want to put at the top of my page when printed and also …

Topic by Nation

crossposted

Software Development
Member Avatar

I have a JTable that has four columns. In the second column I have assigned a JComboBox to be the cell editor of my column.The problem that I encountered is …

Topic by Nation
  1. Why is there AbstractTableModel (works only for methods that are override and if is the correct way), to use DefaultTableModel

  2. Why is there used POJO (public class Product …
Software Development
Member Avatar

I have a JTable that has four columns. In the second column I have assigned a JComboBox to be the cell editor of my column.The problem that I encountered is …

Topic by Nation

aaaach :-)

*My guess is that when the cell is rendered it adds the row, which causes the table to be re-drawn - which renders the cell again - ... …

Software Development
Member Avatar

I have a JTable that has four columns. In the second column I have assigned a JComboBox to be the cell editor of my column.The problem that I encountered is …

Topic by Nation

TableCellRenderer is called from all (could be very intensive, short period and repeatly)

  • Mouse Events inside JTable

  • Key Events

  • events implemented in rellated APIs
Software Development
Member Avatar

Here my code.

package formsign;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;

public class textF extends JFrame{

        private JTextField fname;
    private JTextField lname;
    private JPasswordField …
Topic by haider885

I'm think that is designated for Swing Action