9 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Ann aiko

import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JComboBox; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; public class OtakuHigh extends JFrame{ private JLabel label, label1, label2, label3, label4, label5, label6, label7, label8; private JTextField text1, text2, text4, text5, text7, text8; private JComboBox Mbox, Dbox, Sbox, Ybox, SCbox; private JButton Qbutton; …

Member Avatar for mKorbel
0
211
Member Avatar for milkman93

Hey Guys, I'm want to output a calculation to a JLabel. Example: double num1 = 14; double num2 = 3; double ans; ans = num1/num2; JLabel jl = new JLabel(); add(jl); jl.setText("The Answer is: " + ans); Currently the answer for this will be 4.666666667. Now if this was a …

Member Avatar for milkman93
0
5K
Member Avatar for v3ga

I have a JLabel and a JPanel which both implements MouseClicked methods and I have added the JLabel to the JPanel but when the JLabel is clicked, the MouseClicked method of JPanel is invoked. How to fix this>??

Member Avatar for v3ga
0
154
Member Avatar for StephNicolaou

Hey guys, I've drawn a grid, and I have a label contatining a picture. Whenever I change the location of this label, the grid dissapears until I resize/move the frame. Any suggestions on best method to buffer these grid lines? They aren't going to be moving graphics or anything like …

Member Avatar for StephNicolaou
0
150
Member Avatar for guru_iyer

Hey here's my code for functioning like MS Paint. But JLabels are just not visible. Please Help. [CODE] import java.awt.event.*; import javax.swing.*; import java.awt.*; import java.awt.image.*; public class MSPaint { JFrame frame; JPanel panel; Painting paint = new Painting(); public MSPaint() { frame = new JFrame("MS Paint"); frame.setSize(1024,768); panel = …

Member Avatar for guru_iyer
0
1K
Member Avatar for musikluver4

I want to be able to create JLabels, all different names, with a for loop ex: [CODE] static JLabel[] totalAYearLabelYr = new JLabel[termYears]; [/CODE] So I got 30 JLabels named totalAYearLabelYr, which I'm not sure you can have 30 JLabels named the same thing. I wanna name them all totalAYearLabelYr1 …

Member Avatar for musikluver4
0
7K
Member Avatar for Taimoor Rana

I want to load an image for each different shoe and I'm using JLabel to help me do this. I put the image's path in the JLabel constructor but when the code runs, it doesn't display any image. Instead of an image, the image path is written. appreciate any help …

Member Avatar for ztini
0
242
Member Avatar for ztini

I'm having some fundamental issues with some basic abstraction. Here is the super class: [CODE] public abstract class Tile extends JLabel implements MouseListener { public Tile() { setIcon(new ImageIcon(getClass().getResource("images/blank.gif"))); } @Override public void mousePressed(MouseEvent e) { System.out.println("clicked"); switch(e.getModifiers()) { case InputEvent.BUTTON1_MASK: leftClick(); break; case InputEvent.BUTTON2_MASK: rightClick(); break; } } public …

Member Avatar for ztini
0
184
Member Avatar for ajst

Hi guys, I'm trying to create a 2D array of JLabels my first problem is actually creating them. my code atm is = [CODE] package test; import java.io.File; import javax.swing.JLabel; import javax.swing.JPanel; public class testing extends javax.swing.JFrame { /** Creates new form testing */ public testing() { initComponents(); for(int i …

Member Avatar for ajst
0
1K

The End.