Swing/AWT/SWT :: Remove Data From A Row And Update It

Sep 2, 2014

I have a client server application. The UI for the server contains a JTable and in each row, details of the connected client are shown. Say if I have 5 connections and the 3rd connection disconnects, I need the 4th and 5th connection details to be displayed in 3rd and 4th row respectively. Can this be done?

View Replies


ADVERTISEMENT

Inventory Form Program - User Update Data In The Table

Apr 30, 2015

I'm getting ready to code a program that takes record of items loaned and return in a table. I want more than one user to access the program to be able to update the data in the table. For instance, if one user added 5 new items to the table, all other users would be able open the program to see a modified table with 5 new items. Was looking for some advice and was wondering if implementing a database would work best.

View Replies View Related

Swing/AWT/SWT :: How To Remove Jtable Border

Apr 26, 2015

How can I remove the light blue border? I tried everything that I know [URL]

View Replies View Related

Swing/AWT/SWT :: How To Remove Color Background Of JFrame

Feb 11, 2015

I have added a background image to this JFrame (see image attached) as I want the buttons and field to just be on top of the image, how to remove the colored part of the JFrame that is left?

View Replies View Related

Swing/AWT/SWT :: Using Image As Button - Remove Border?

Oct 10, 2014

I tried a few things and I was unsuccessful at removing the border around my image button. It seemed simple enough when reading on StackOverflow but I'm still getting errors : s

ImageIcon cardIcon_1_1 = new ImageIcon("../images/empty.png");
JLabel cardImg_1_1 = new JLabel(cardIcon_1_1);
cardImg_1_1.setBorder(BorderFactory.createEmptyBorder());
cardImg_1_1.setContentAreaFilled(false);

Errors:

Multiple markers at this line
- Syntax error on token ";", @ expected
- Syntax error on token ".", @ expected after this token

Multiple markers at this line
- Syntax error, insert "Identifier (" to complete
MethodHeaderName
- Syntax error, insert "SimpleName" to complete
QualifiedName
- Syntax error, insert ")" to complete MethodDeclaration

I'm using an applet it had to be in the initialize part of my program...

View Replies View Related

Swing/AWT/SWT :: How To Update Image In Java GUI

Jul 10, 2014

I have a GUI with several buttons and I'm using NetBeans GUI Builder to do. At the click of one of these I would like for it to open another frame containing a picture. So I associate a listener (actionPerformed) the button and when clicked it opens actually post the new frame.

In the new frame I waxed a JLabel and then I associate the image of the label. I saw that to do that NetBeans generates this code:

label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/tree.png")));

My problem is that the picture is overwritten several times during the execution of the program is not changed yet in the frame. That is, in the new frame is always displayed an old version of the image.

I have an image that is created every time I click on the button (it always has the same name and same path). Basically I have a generic tree on which I perform the operations (add, remove, etc..). When I click on the button I call a method that generates the image of the tree (using Graphviz). So I have one image that changes over the time...

How can I do so that the image is always up to date?

The Code:

package View;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
public class AlberoIpotesi extends javax.swing.JFrame {

[Code] ....

View Replies View Related

Hot To Get A Swing Timer To Update At Different Times

Apr 27, 2014

I'm working on a space invades game and I have a swing timer set up to update the score(number of aliens killed) and for the aliens to shoot. I'm trying to get the score to update at say 100 ms, but the aliens to shoot at 3200ms. I tried to use 2 timers one for the aliens, and one for the score,but the aliens would just use faster score timer.

import java.awt.Color;
import java.awt.Container;
import java.awt.event.ActionEvent;

[Code]......

View Replies View Related

Swing/AWT/SWT :: How To Update The Table On Screen

Mar 11, 2014

I'm writing my first bigger program (mysql connection and the first thing bigger than 300 lines ). What I'd like to do is to render data from MySQL using JTable - I managed to handle all the queries but I don't know how to update the table on screen. I've tried to use repaint() but nothing happened. I'm not posting whole code because you'll probably not interested, below are the most important things. I thought about using TableModel but how.

public class Main implements ActionListener{
JTable table;

public Main() {
JFrame frame = new JFrame("Frame");
frame.setLayout(new FlowLayout());
frame.add(table);

[code]...

View Replies View Related

Swing/AWT/SWT :: Which Event Is Generated When Scrollbar Update

Jan 1, 2015

Which event is generated when a scrollbar is update?

View Replies View Related

Swing/AWT/SWT :: Remove Or Hide Selected JCheckBox From A List In GroupLayout?

Dec 9, 2014

There are 8 JCheckboxes, which are already added to panel and aligned in group layout. From which, I have selected one JCheckbox. Then the resultant GUI should contain only remaining 7 JCheckboxes and selected one should temporarily removed or hide from GUI . Is it possible? If so, how?

View Replies View Related

Java Array Update Without Using ArrayList - Add Values And Update Size?

Feb 9, 2015

I am trying to create an array list without using the built in arrayList class that java has. I need to start the array being empty with a length of 5. I then add objects to the array. I want to check if the array is full and if not add a value to the next empty space. Once the array is full I then need to create a second array that starts empty and with the length of the first array + 1.

The contents of the first array are then copied into the new array without using the built in copy classes java has and then the new array ends up containing 5 elements and one null space the first time round. The first array is then overwritten with the new array containing the 5 elements and the null space. The process then starts again adding values until the array is full which will be 1 more value then recreating the second array empty and the length of the first array + 1. This is my attempt at creating this but I have run into multiple problems where I get only the last value I added and the rest of the values are null:

public class MyArrayList {
public Object arrayList[];
public MyArrayList(Object[] arrayList) {
this.arrayList = arrayList;

[code]...

View Replies View Related

Swing/AWT/SWT :: How To Update / Refresh JPanel On JButton Click

Apr 14, 2015

I am trying to plot a graph and graph should display when JButton is clicked. To create data set, I am taking some value through JTextField and then created a chart and plotted it. I've got a problems: the chart doesn't refresh/update when I change the text field value.

public class Test2 extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
private JPanel contentPane;
private ChartPanel chartPanel;
private JTextField textField_1;
double a;

[Code] ....

View Replies View Related

Swing/AWT/SWT :: How To Update Character Count As User Is Counting

Mar 16, 2014

i need a password program that does the following:

- only shows the character count
- toggles between seeing the actual letters and character count in the text field with a button

i don't know how to update the character count as the user is counting.i read the oracle tutorial, and i have a vague idea that i'm supposed to use Document Listener but i'm quite clueless here.for the second part i'm thinking about using white space for the masking character and unmasking the field.

View Replies View Related

Swing/AWT/SWT :: How To Update JPanel Rather Than Refresh It Every Time On Calling Repaint

Jan 4, 2015

I would like to be able to draw things onto the panel (via paintComponent), but I'd like it to draw 'on top' of what's already there. The default seems to be that it resets every time I call repaint.

View Replies View Related

Swing/AWT/SWT :: Update JTable Cell Values Inside A Loop

Jan 5, 2015

I have a program where i want to indicate the user when i have completed a task which i am running inside a for loop. Below is my code.

for(Map.Entry<Double,SimplestCopyInstance> entry : myList.entrySet()){
double key = entry.getKey();
SimplestCopyInstance scp = entry.getValue();
Copy cp = new Copy();
cp.putLocations(scp.getSrc(), scp.getDes());
scp.setStatus(cp.baseCopy()+"");

[Code] ....

I have used netbeans to build my app. So there creating jTable is out of my control as that part was inside auto-generated code. I have just used the jTable.setValue().

My problem is, above method is inside a button click event. Updated values not displaying until the loops ends.

View Replies View Related

JSF :: Update Action Does Not Update Bean Attribute

May 14, 2014

I have a strange behaviour when trying to update a bean. Here is the edit page:

<h3>Edit Post</h3>
<div class="row">
<h:form>
<div class="small-3 columns">
<label for="right-label" class="right inline">Title</label>

[Code] ....

Here is the bean class:

package com.airial.controllers;
import com.airial.domain.Post;
import com.airial.service.PostService;
import com.ocpsoft.pretty.faces.annotation.URLMapping;
import com.ocpsoft.pretty.faces.annotation.URLMappings;
import org.springframework.beans.factory.annotation.Autowired;

[code]...

postToUpdatet is always NULL. Why the title property is not binded ? What is wrong here ?

View Replies View Related

Swing/AWT/SWT :: JTextField - How To Remove Text When User Clicks On Text Field

Jan 28, 2014

I have a textField in which I have text in. The text is enter customer name. I would like for this text to disappear whenever the user clicks on the textField to enter a customer name. I am using the automated swing gui builder in NetBeans. Is their some sort of feature for this under properties of the text field? If not then what are my other options?

View Replies View Related

Swing/AWT/SWT :: Update Progress Of A Process In Progress Bar - Java GUI

Nov 29, 2014

In my Java SWT application, I have few methods, that take longer time to complete. These methods has to be initiate and run as response to button click. There I want to implement progress bar to show the progress/status of long run method. Long run methods are Java Processes, in which it executes some command line functionality. (ex: run ls method in Linux).

Process p = Runtime.getRuntime.exec(command)

In progress bar status is set using setSelection method which takes int as argument. How to indicate the progress of process in progress bar, because I don't have int value to pass into setSelection method of progressbar.

View Replies View Related

Swing/AWT/SWT :: How To Get Data From JTextField Over To JTable

Jun 20, 2014

I am trying to get the data entered in a JTextField into a JTable but not clear on how. The LeftPanel is where the button is located and the RightPanel is where the JTable is. I want the actionPerformed to update the row of the JTable but I can't figure out how. There is another class that controls the GUI but did not think it was necessary to include. Also, I am aware that I am getting an error at the addRow line, can't seem to alleviate it.

public class LeftPanel extends JPanel {

private static final long serialVersionUID = -2311952438693382407L;
private RightPanel rPanel;
public LeftPanel(){
Dimension size = getPreferredSize();
size.width = 250;
setPreferredSize(size);

[code]....

View Replies View Related

Swing/AWT/SWT :: Refreshing Data In A JTable?

Apr 24, 2014

I have been trying to learn a bit about JTables for a project I want to undertake. I have created a new JFrame in netbeans and added a button. Onclicking the button I want add some data to a JTable model and then output the JTable with the data. When I click the button again I want the same process to happen again and overwrite the previous table being displayed.

I have written the following code below:

import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

[code].....

The problem I have is that when I click the button for a second time the table stays on the screen exactly as it did following the first click. I can see that the data in the model is changing so I am not sure why a new JTable is not drawn.

View Replies View Related

Add TextField Data To A List Using Swing?

Nov 14, 2014

Trying to make a swing box where you can type in string data to the text field and a button. I want the string data to be added to a list everytime you press the addbutton.

Here is the code:

PHP Code:

package GUI;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JButton;

[code]....

View Replies View Related

Swing Applet - How To Display Data

Oct 28, 2014

I'm doing a project in which I must display prices of computer accessories in a Scroll Pane viewer. The if statements are all checkboxes. I am completely lost with how to print to the viewer if a checkbox is selected. Furthermore, I am also lost with how to add up all of the checkboxes.

private void USBCheckActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
double area = 0;
double computerprice = 500.0;
if (printerCheck.isSelected()){
double printer = 100.0;

[Code]...

View Replies View Related

Swing/AWT/SWT :: Display Data From XML File In DefaultTableModel?

Oct 5, 2009

i need to display the data from an xml file in a DefaultTableModel using the addRow method. in my table there are three columns named "symbol", "info" and "value", so i must create arrays of string objects from nodelists and insert them in the model with something like - addRow(new Object[] { getSymbolData, getInfoData, getValueData } ); but im stuck and cant seem to get it right.

View Replies View Related

Swing/AWT/SWT :: Saving And Loading Data Of Jtable

Apr 6, 2015

I am trying to make a program where a user can enter guests name for a hotel, the JTable includes rows for the name of the tenant, the room number, month etc.

I've made the table, however I am having some trouble in saving the data that I put into the table. I used jtextfield and a jbutton to but data into the jtable. I am trying to save the data, and load it just buy clicking a button.

table.setModel(new DefaultTableModel(
new Object[][] {
},
new String[] {
"Room", "Name", "Month", "Payment"//table rows
}
));

This is my basic table. And what I'm trying to do to save the data is:

DefaultTableModel model = new DefaultTableModel();
private JFileChooser myJFileChooser = new JFileChooser(new File("."));
private void saveTable() {
if (myJFileChooser.showSaveDialog(null) ==
JFileChooser.APPROVE_OPTION ) {
saveTable(myJFileChooser.getSelectedFile());

[Code] ....

When I run my program, I'm able to click on a button, and the dialog box will appear, I'm also able to save the data to a file. However when I click on the retieve data button I made the dialog box opens, the file is there, however when I click it, nothing happens.

View Replies View Related

Swing/AWT/SWT :: JTable - How To Repaint With Updated Data

Jun 5, 2014

Here's what I would like to happen:

Java/Swing dialog box appears on the user's screenIt allows the user to enter 2 values into labelled text fields (fname/sname)They select a "Click Me" push button which I hope will write the data into the table. But the table does not get refreshed.

If I minimise the dialog box and then open it again, the data still does not appear.

The code I originally built using eclipse/WindowBuilder. I've cut it back and tried to isolate the issue. But I still cannot figure it out.

I've added some diagnostic log messages to ensure that I am seeing the various events I think I need to see and have put code in the action callbacks etc.

import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.GridBagLayout;

[Code] .....

View Replies View Related

Swing/AWT/SWT :: Restricting Data Entry In TextFields

Mar 4, 2015

I'd like to know is there a way to restrict a user from inputting certain characters into a TextField? Is there something like isNumeric() available?

In Visual Basic, I was able to prevent the user entering certain characters of my choice into each textbox, however I've looked and I haven't been able to find a solution. I've tried using the following else if as part of an if statement:

else if (txtEmployeeName.getText().contains("[0-9]+"){ }

but it doesn't seem to work.

View Replies View Related







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