JButton Adding Problem
Hi everyone,
First, like to say I appreciate all your help. I have come here for help before and I always get my questions answered. Thanks.
Here is my problem:
I've created a JPanel and added this panel to a JFrame. The JPanel has a MouseListener and a MouseMotionListener. I am tryin to add JButtons to the JPanel at positions passed from the MouseMotionListener, but everytime I attempt this, the JButton pops to the top left corner of the screen. I don't know if I should use a layout manager on the JPanel and if I do, I don't know which one to use. I've tried using the SpringLayout, but was unsuccessful at deploying it.
Appreciate any help.
Thanks again.
Null layout is not recommended, see my earlier post. Here is a simple SpringLayout that does the same thing.
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
public class TestSpring extends JFrame
Container cp;
int mpx, mpy;
int MINX= 80;
int MINY=20;
JLabel txt = new JLabel("use mouse to position buttons, drag to set size");
SpringLayout slay = new SpringLayout();
MouseInputAdapter mia = new MouseInputAdapter()
public void mousePressed(MouseEvent evt){mousePress(evt);}
public void mouseReleased(MouseEvent evt){mouseRelease(evt);}
TestSpring()
super("TestSpring");
cp = getContentPane();
addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent evt){System.exit(0);}});
cp.addMouseListener(mia);
cp.setLayout(slay);
cp.add(txt);
setBounds(0,0,700,400);
void mousePress(MouseEvent evt)
mpx = evt.getX();
mpy = evt.getY();
void mouseRelease(MouseEvent evt)
int x,y,dx,dy;
x = evt.getX();
y=evt.getY();
dx = x-mpx;
dy = y-mpy;
if(dx < 0){dx = -dx; mpx = x;}
if(dy < 0){dy = -dy; mpy = y;}
JButton jb = new JButton(mpx+","+mpy);
cp.add(jb);
setCPosition(jb,mpx,mpy);
if(dx < MINX)dx = MINX;
if(dy < MINY)dy = MINY;
setCSize(jb, dx, dy);
cp.validate();
void setCPosition(Component c, int x, int y)
slay.getConstraints(c).setX(Spring.constant(x));
slay.getConstraints(c).setY(Spring.constant(y));
void setCSize(Component c, int w, int h)
slay.getConstraints(c).setWidth(Spring.constant(w));
slay.getConstraints(c).setHeight(Spring.constant(h));
// the main startup function
public static void main(String[] args)
new TestSpring().show();
}
Similar Messages
-
JButton.setBackground() Problem
Hi All,
When i apply the setBackground() Method to a JButton to set its Background, i face i Problem :
Under Mac Os : The JButton DOSE NOT change its color,
when i take my code to my other computer under Windows : OK, the JButton change...
i am wondering ....
1) Why under my Mac OS i face this problem...
2) and Why i get two different results from a same code ??? Java is not Portable?? and independant of the OS?? or it is the swing that makes the problem???
My code is so simple :
MyJButton.setBackground(new Color(255,100,100));
Thanks to any help...ellias2007 wrote:
Sorry because it is the first time for me in this forum....
thanks for any help...
Sorry againMost of us don't like disjointed discussions or repeating effort for a problem that has already been solved elsewhere. Thanks for your reply. A link to one discussion: [http://www.java-forums.org/awt-swing/25986-jbutton-setbackground-problem.html]
If you have cross-posts elsewhere, please post links in all of them to each other or to one central location. -
hey, at first I want to say that I was looking here and on google about my problems and I did find nothing :/.
I had in my JButton ImageIcon like that:
JButton button = new JButtone(ImageIcon sampleImage);
and all is great. But i need in my program to change the background when user enter with mouse on this button and here is the problem, because that sampleImage what i added before should stay the same and as the background I want to add another image. So to sum up: I want to add as background the image...I was looking any solution for 5 hours and I cant find anyhing :(. Can anyone help?
Thanks in advance
-mikeLoad one image and then load a different image--you have reference to them with 2 different variables. Once you have them loaded set one as the default background, then look at MouseListener and MouseEvent for a mouse over action, when you get the mouse over, then change the background image to the one that is not displayed. Since you only have 2 images you can keep track of which one is being displayed with a boolean flag--something like boolean isDefault = true;
Now if you need help with code, post what you have so far and ask specific questions. -
I would have thought the following would bring up two identical MainWindows, but in fact the buttons in the second one look slightly different.
public class Main {
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
setUpApp();
private static void setUpApp() {
MainWindow mainWindow = new MainWindow();
MainWindow mainWindow2 = new MainWindow();
}This is what the two windows look like after display: (How do URLs work?)
I'm not really sure what code to paste other than this because I would think the code is identical for both.Slow day, and I actually created an SSCCE:
import javax.swing.*;
import java.awt.*;
public class MainWindow {
private JFrame topLevelContainer;
public MainWindow() {
topLevelContainer = new JFrame();
topLevelContainer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
topLevelContainer.setPreferredSize(new Dimension(400, 400));
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
topLevelContainer.setTitle("ChatApp");
topLevelContainer.setVisible(true);
JPanel contentPane = new JPanel(new BorderLayout(2, 2));
contentPane.setBorder(BorderFactory.createLineBorder(Color.BLUE));
contentPane.setBackground(Color.BLUE);
topLevelContainer.setContentPane(contentPane);
JPanel sendingTo = new JPanel();
sendingTo.setOpaque(false);
sendingTo.setBorder(BorderFactory.createTitledBorder("Sending To"));
contentPane.add(sendingTo, BorderLayout.PAGE_START);
JPanel messageLog = new JPanel();
messageLog.setOpaque(false);
messageLog.setBorder(BorderFactory.createTitledBorder("Message Log"));
contentPane.add(messageLog, BorderLayout.CENTER);
JPanel sendPanel = new JPanel(new BorderLayout(2, 0));
sendPanel.setBackground(Color.BLUE);
JTextArea sendMessageArea = new JTextArea("Send Message Area", 5, 30);
sendMessageArea.setOpaque(false);
sendPanel.add(sendMessageArea, BorderLayout.CENTER);
JButton _sendMessage = new JButton("Send Message");
sendPanel.add(_sendMessage, BorderLayout.LINE_END);
contentPane.add(sendPanel, BorderLayout.PAGE_END);
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
topLevelContainer.pack();
private static void createAndShowUI() {
new MainWindow();
new MainWindow();
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
createAndShowUI();
}And in it, I notice that you're setting your GUI visible before adding components and your setting the look and feel after you've created and added components, and this seems a bit backwards. The look and feel issue is what is causing the problem that you are noticing. -
A\R Invoice Payment adding problem,
Hello all
I am trying to add invoice details by SDK from a XML file which is generated by another application, A/R Invoice details are adding successfully, but when I am inserting Payment details from SDK(VB.net) Its generating error message
The contact person defined in the Business Partner Master Data is not valid ORCT.CntctCode
and so payment details is not inserting in SAP B1, Please help me, I am giving sample code below please tell me what to do.
Strange thing is running well in our server but in client's server its only generating error.
/* there has some code to fill myInvoice which is working properly*/
status = myInvoice.Add()
Dim vPay As SAPbobsCOM.Payments
Dim vCustomer As SAPbobsCOM.BusinessPartners
Dim sqlstr As String
vCustomer = CType(ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners), BusinessPartners)
vCustomer.GetByKey(xml.Order_Details.custCode)
vPay = CType(ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments), Payments)
vPay.CardCode = vCustomer.CardCode
sqlstr = String.Format("SELECT TOP 1 * FROM OCPR Where CardCode=''", vCustomer.CardCode)
lRecordset.DoQuery(sqlstr)
If (Not lRecordset.EoF) Then
lRecordset.MoveFirst()
vPay.ContactPersonCode = CInt(lRecordset.Fields.Item("CntctCode").Value)
logger.Info("ContactPersonCode:" & lRecordset.Fields.Item("CntctCode").Value.ToString())
'logger.Info(vCustomer.GetAsXML())
End If
vPay.Invoices.DocEntry = CType(DocEntry, Integer)
vPay.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Invoice
vPay.Invoices.SumApplied = xml.Order_Details.subtotal
vPay.Invoices.Add()
vPay.CashSum = xml.Order_Details.cash
'vPay.DocDate = DateTime.Now
vPay.DocTypte = SAPbobsCOM.BoRcptTypes.rCustomer
status = vPay.Add() /* In this line its generating Error code -10 and following message*/
The contact person defined in the Business Partner Master Data is not valid ORCT.CntctCode
Please help me. How can I get ORCT.CntctCode how to initialize properly in run time.
Edited by: kishorebarik26 on Nov 9, 2010 3:24 PMHello to All,
This problem occurs, when you duplicate a Business Partner, and you make payment over the duplicated BP.
You may check the OCRD table, and look for default contact field (cntctPrsn). please check he value inside, maybe this value is not belogns to the user.
You may also check the BilltoDef and ShiptoDef fields, maybe the error comes from these fiedls, but the error message is put you into an incorrect path.
I had similar problem in payments whith the addresses, so i know this situation from there. Also logged the support ticket to GSC, and the answer was: this issue is coming from the usage not from the application.
Regards
János -
hello ,
i am facing a problem in changing the imageicon of jbutton in my application.
i want to change imageicon for few seconds and than again change it to original imageicon....
is it possible?????????????i have tried but after initializing button with one imageicon we are not able to change that icon again..
so what should i do...it is compulsory to change take two image for button.....
please helpSet up a Timer. You use the setIcon(...) method to change the icon. Then you start a Timer to fire in a few seconds and use the setIcon(...) method to change the image back to its original value.
-
[bc4j] Urgent jbutton binding problem
Hi,
I have a working application with a few panels, and a few viewobjects, viewlinks, etc. I can use the navigator to navigate through the records, etc, everything works fine.
But when I add a jbutton to the panel, with an action binding for the view object ('insert new record' or 'next'), then when starting up the application, the view object begins to spill, all records seem to be loaded and spilled to the spill-table.
If I remove the model form the jbutton and re-run, everything works fine again. What could cause this? All other binded controls (navigationbar, several jtextfields, and even a jtree) work fine, but the jbutton causes spills.
And not even when I click it, but during startup of the app!
Any idea?
Greetings,
IvoBug#2772798 filed after reproducing using your testcase. Thanks.
Shailesh got back to me with this analysis:
No bindings should force a range size of -1 by default except for Lov Bindings on Combo and List Boxes where all the data is needed on the client side control.
ButtonlActionBinding's create method is setting the rangesize of the iterator to -1 leading to all rows being fetched. The workaround is to set the range size on the iterator in setPanelBinding() method after jbInit() to a desired size.
Here's a line I added to Ivo's setPanelBinding() method of his PanelFootballView1.java class...
jbInit();
panelBinding.findIterBinding("FootballViewIter1").getRowSetIterator().setRangeSize(1); -
Hi,
I've got JButtons in a JTable which means I have to capture the mouse events and forward them to the button.
I do this with a mouse listener on the table, and the lines:
buttonEvent = (MouseEvent)SwingUtilities.convertMouseEvent(table, e, button);
button.dispatchEvent(buttonEvent);
System.out.println(buttonEvent);
table.repaint();where 'e' is the original mouse event. This produces, for example:
java.awt.event.MouseEvent[MOUSE_CLICKED,(145,167),button=1,modifiers=Button1,clickCount=1]
on
javax.swing.JButton[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5 <snip> text=Delete,defaultCapable=true]but yet nothing happens to the button. Is this a coordinate problem, or am I missing something else, as I don't really know what I'm doing?
Cheers,
RobMOUSE_CLICKED,(145,167),Well I'm guessing that you can't just convert the table coordinates and use them as the button coordinates because the button isn't that big.
An alternative approach might be to use the doClick() method of the button.
In case that doesn't work, here's something I've been playing with that may help:
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
public class TableButton3 extends JFrame
public TableButton3()
String[] columnNames = {"Date", "String", "Integer", "Decimal", ""};
Object[][] data =
{new Date(), "A", new Integer(1), new Double(5.1), "Delete1"},
{new Date(), "B", new Integer(2), new Double(6.2), "Delete2"},
{new Date(), "C", new Integer(3), new Double(7.3), "Delete3"},
{new Date(), "D", new Integer(4), new Double(8.4), "Delete4"}
DefaultTableModel model = new DefaultTableModel(data, columnNames);
JTable table = new JTable( model )
// Returning the Class of each column will allow different
// renderers to be used based on Class
public Class getColumnClass(int column)
return getValueAt(0, column).getClass();
JScrollPane scrollPane = new JScrollPane( table );
getContentPane().add( scrollPane );
// Create button column
ButtonColumn buttonColumn = new ButtonColumn(table, 4);
public static void main(String[] args)
TableButton3 frame = new TableButton3();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.pack();
frame.setVisible(true);
class ButtonColumn extends AbstractCellEditor
implements TableCellRenderer, TableCellEditor, ActionListener
JTable table;
JButton renderButton;
JButton editButton;
String text;
public ButtonColumn(JTable table, int column)
super();
this.table = table;
renderButton = new JButton();
editButton = new JButton();
editButton.setFocusPainted( false );
editButton.addActionListener( this );
TableColumnModel columnModel = table.getColumnModel();
columnModel.getColumn(column).setCellRenderer( this );
columnModel.getColumn(column).setCellEditor( this );
public Component getTableCellRendererComponent(
JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
if (hasFocus)
renderButton.setForeground(table.getForeground());
renderButton.setBackground(Color.WHITE);
else if (isSelected)
renderButton.setForeground(table.getSelectionForeground());
renderButton.setBackground(table.getSelectionBackground());
else
renderButton.setForeground(table.getForeground());
renderButton.setBackground(UIManager.getColor("Button.background"));
renderButton.setText( (value == null) ? "" : value.toString() );
return renderButton;
public Component getTableCellEditorComponent(
JTable table, Object value, boolean isSelected, int row, int column)
text = (value == null) ? "" : value.toString();
editButton.setText( text );
return editButton;
public Object getCellEditorValue()
return text;
public void actionPerformed(ActionEvent e)
fireEditingStopped();
System.out.println( "Action: " + e.getActionCommand() );
} -
JButton clicked problem?
I have a Jbutton and on button clicked, action is performed.
Now if mouse is just clicked but moved only one pixel(means focus is still on the button) , action will not occur. It works only if the button is clicked and mouse does not move at all. I want action if the button is clicked and does not leave the button forground area until it is released.
thnxSounds like there is a problem in your code. Only can make wild guesses based on the lack of info. (If you post code, please spare us the pain of looking at all of it, just create a simple example).
-
Hi All,
I have a primitive /as I known/ problem with the JButton.
I create one, and set the text with this 'Show'. I set the font /eg. Arial/ and it's size to 9.
If I set the required size of the button the text is not shown. /shown only .../
When show the text correctly the width of button is very large for me.
How can I make a button which hase a same width such as the text in it.?
thx.Once you've set the font and text for a button, you can find out its preferred size using getPreferredSize.
Typically buttons will add on padding between the text and the border. This is known as the "margin" and can be changed using setMargin.
You can set the margin for all buttons using UIManager's Button.margin property.
Hope this helps. -
Hello Java Brothers!
I have written this class:
* Created on 07-nov-2003
package uax.nti.news.servidor.gui;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class Panel_Derecho_Usuarios extends JPanel {
JButton b_borrarCliente = null;
JPanel accionesCliente = null;
DefaultTableModel modelo_Tabla = null;
JTable tabla = null;
JScrollPane scrollPane = null;
Vector columnas = null;
public Panel_Derecho_Usuarios() {
super();
columnas = new Vector ();
columnas.add("Id");
columnas.add("Nick");
columnas.add("Nombre");
inicializar();
}//constructor
private void inicializar ( ){
EventosBoton eventosBoton = EventosBoton.getReferencia();
this.setLayout( new BorderLayout ());
modelo_Tabla = new DefaultTableModel ( columnas,10){
public boolean isCellEditable (int x, int y ){ return false; }
tabla = new JTable ( modelo_Tabla);
scrollPane = new JScrollPane ( tabla );
b_borrarCliente = new JButton ("Borrar usuario");
b_borrarCliente.setActionCommand("borrar_usuario");
b_borrarCliente.addActionListener(eventosBoton);
accionesCliente = new JPanel ( );
accionesCliente.setLayout( new FlowLayout ( FlowLayout.RIGHT));
accionesCliente.add(b_borrarCliente);
this.add ( scrollPane, BorderLayout.CENTER );
this.add ( accionesCliente, BorderLayout.SOUTH);
}//inicializar
private void borrarTabla ( ){
modelo_Tabla.setDataVector(new Vector(10), columnas);
modelo_Tabla.fireTableDataChanged();
}//borrarTabla
public void actualizarTabla ( Vector datos ){
borrarTabla ();
int tama?oDatos = datos.size()/3;
Object [] buffer_Temp = new Object [this.modelo_Tabla.getColumnCount()];
int indiceAux = 0;
for ( int indice = 0; indice < tama?oDatos; indice ++ ){
buffer_Temp[0] = datos.elementAt(indiceAux++);
buffer_Temp[1] = datos.elementAt(indiceAux++);
buffer_Temp[2] = datos.elementAt(indiceAux++);
this.modelo_Tabla.insertRow(indice, buffer_Temp);
}//for
modelo_Tabla.fireTableDataChanged();
}//actualizarTabla
public void a?adirFila (Vector nuevaLinea ){
this.modelo_Tabla.insertRow(0,nuevaLinea);
modelo_Tabla.fireTableDataChanged();
}//a?adirFila
}//clase
PROBLEM:
If i call the method a?adirFila ( addRow ) in the constructor there is not any problem, everything works fine! BUT when I call the a?adirFile method from anywhere else I do not get my table updated!
Please help me,
SitomaniaHello Java Brothers!
I have written this class:
* Created on 07-nov-2003
package uax.nti.news.servidor.gui;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class Panel_Derecho_Usuarios extends JPanel {
JButton b_borrarCliente = null;
JPanel accionesCliente = null;
DefaultTableModel modelo_Tabla = null;
JTable tabla = null;
JScrollPane scrollPane = null;
Vector columnas = null;
public Panel_Derecho_Usuarios() {
super();
columnas = new Vector ();
columnas.add("Id");
columnas.add("Nick");
columnas.add("Nombre");
inicializar();
}//constructor
private void inicializar ( ){
EventosBoton eventosBoton = EventosBoton.getReferencia();
this.setLayout( new BorderLayout ());
modelo_Tabla = new DefaultTableModel ( columnas,10){
public boolean isCellEditable (int x, int y ){ return false; }
tabla = new JTable ( modelo_Tabla);
scrollPane = new JScrollPane ( tabla );
b_borrarCliente = new JButton ("Borrar usuario");
b_borrarCliente.setActionCommand("borrar_usuario");
b_borrarCliente.addActionListener(eventosBoton);
accionesCliente = new JPanel ( );
accionesCliente.setLayout( new FlowLayout ( FlowLayout.RIGHT));
accionesCliente.add(b_borrarCliente);
this.add ( scrollPane, BorderLayout.CENTER );
this.add ( accionesCliente, BorderLayout.SOUTH);
}//inicializar
private void borrarTabla ( ){
modelo_Tabla.setDataVector(new Vector(10), columnas);
modelo_Tabla.fireTableDataChanged();
}//borrarTabla
public void actualizarTabla ( Vector datos ){
borrarTabla ();
int tama?oDatos = datos.size()/3;
Object [] buffer_Temp = new Object [this.modelo_Tabla.getColumnCount()];
int indiceAux = 0;
for ( int indice = 0; indice < tama?oDatos; indice ++ ){
buffer_Temp[0] = datos.elementAt(indiceAux++);
buffer_Temp[1] = datos.elementAt(indiceAux++);
buffer_Temp[2] = datos.elementAt(indiceAux++);
this.modelo_Tabla.insertRow(indice, buffer_Temp);
}//for
modelo_Tabla.fireTableDataChanged();
}//actualizarTabla
public void a?adirFila (Vector nuevaLinea ){
this.modelo_Tabla.insertRow(0,nuevaLinea);
modelo_Tabla.fireTableDataChanged();
}//a?adirFila
}//clase
PROBLEM:
If i call the method a?adirFila ( addRow ) in the constructor there is not any problem, everything works fine! BUT when I call the a?adirFile method from anywhere else I do not get my table updated!
Please help me,
Sitomania -
<mx:HBox id="hb2" width="250" height="60" x="40" y="92" horizontalGap="0" creationComplete="cc();"/>
private function cc():void{
for(var i:int=25,j:int=1;i<=hb1.width;i=i+25,j++)
box = new Box();
box.width=25;
box.height = hb1.height;
box.setStyle("borderStyle","solid");
box.setStyle("borderColor","black");
box.setStyle("verticalAlign","middle");
box.setStyle("horizontalAlign","center");
hb1.addChild(box);
lab = new Label();
lab.text = "A"+j;
box.addChild(lab);
it's adding the boxes to HBox and inturn box contains the label inside it
it's working fine
but the problem is that when I provide rotation property for the hb2 i am not getting the labels
<mx:HBox id="hb2" width="250" height="60" x="40" y="92" horizontalGap="0" rotation="40" creationComplete="cc();"/>
please................ help meMyriad fonts for free: Download Adobe Lightroom.
Ctrl-click on the Lightroom icon, and Show Package Contents.
Drill down to Contents:Frameworks:AgUI.framework:Versions:A:Resources and behold:
MyriadPro-Black.otf
MyriadWebPro-Bold.ttf
MyriadWebPro-Condensed.ttf
MyriadWebPro-CondensedIt.ttf
MyriadWebPro-Italic.ttf
MyriadWebPro.ttf
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex / AIR Development, Training, and Support Services -
JButton NullPointerException problem
Hi
I was wondering if you guys can help me out on this one. I'm been prompted with a NullPointerException whenever I click on either of the 2 buttons.
Thanks guys
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Alarm extends JPanel implements ActionListener{
private JTextArea messageField;
private JButton alarmOn, alarmOff;
private JLabel alarmLED;
public Alarm(){
super.setPreferredSize(new Dimension(200,300));
//configuring components;
JButton alarmOn = new JButton("On");
alarmOn.addActionListener(this);
JButton alarmOff = new JButton("OFF");
alarmOff.addActionListener(this);
JLabel alarmLED = new JLabel("Alarm OFF");
alarmLED.setOpaque(true);
alarmLED.setBackground(Color.GREEN);
messageField = new JTextArea(2,20);
messageField.setEditable(false);
messageField.setPreferredSize(new Dimension(200, 200));
this.add(messageField, BorderLayout.PAGE_START);
alarmOn.setPreferredSize(new Dimension(80, 20));
this.add(alarmOn, BorderLayout.LINE_START);
alarmOff.setPreferredSize(new Dimension(80, 20));
this.add(alarmOff, BorderLayout.CENTER);
alarmLED.setPreferredSize(new Dimension(65, 30));
this.add(alarmLED, BorderLayout.LINE_END);
public void actionPerformed(ActionEvent event){
if(event.getSource()==this.alarmOn){
this.alarmLED.setBackground(Color.RED);
this.alarmLED.setText("Alarm ON");
}else{
this.alarmLED.setBackground(Color.GREEN);
this.alarmLED.setText("Alarm OFF");
}//end of class;I figured it out...I think i declared the button twice.
Funny...it seems easier to spot it in this forums comparing it on BlueJ
Will someone recommend me a better java client then BLueJ?
Preferably user friendly kinds
Thanks -
I've got a problem with my iTunes, i cant add video files. when i try it just won't add it, no error, no nothing. i converted it to mpeg4 but still the problem remains.
help?
thanks.If you're not already doing it this way, you have to change the video quality/resolution to a certain setting for ipod to be able to play it. I use a program called dvd fab platinum that is designed to reformat it for you.
-
Photo adding problem iphone 4g
photo add problem from latest itues to iphone 4g 6.0.1
Read the article from which the thread was created and follow the troubleshooting steps provided.
Maybe you are looking for
-
I was the first person in my state to have a white 920. It was the only one available according to the rep, to the dismay of everyone in line behind me. (I was first in line at the store ) I have been amazingly pleased with the updates, in both speed
-
Ipod Touch 2g not able to upload Nike+ data to iTunes 10.2.1
Hi, I can no longer sync my runs from iPod touch 2g to iTunes, let alone to Nike+. The last run I can see on iTunes is from March 6th, no runs after that day appear. I have upgraded to newest iTunes in between. Did someting happen to Nike+ support? T
-
I'm having trouble transfering my music from the ipod touch to my new laptop.My old pc got a virus and is dead.All the music I had is on the ipod now. When I try to sync it on the laptop with Itunes, it only transfers the purchased music. How do I t
-
Hi all, Is it possible to copy video clips from Youtube and burn them to a DVD. And what is the proseedure? Many thanks
-
Error with itunes 7 installation
When I try and install the newest itunes an error comes up during installation. It reads, "Error 1921. Service Ipod. Service could not be stopped. Verify that you have sufficient privileges to stop system services." I am trying to sync my new ipod wi