Jump to content

Spyros13

Members
  • Posts

    5
  • Joined

  • Last visited

Spyros13's Achievements

Lepton

Lepton (1/13)

1

Reputation

  1. Hi all i am working on a java project this is my code: import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; public class Image extends JFrame { private JButton AlignLeft,AlignRight,AlignCenter,Resize; public Image (String title){ super (title); Container contentPane = getContentPane(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(); ImageIcon icon = new ImageIcon("icon_01.jpg"); JLabel label = new JLabel(); label.setIcon(icon); panel.add(label); getContentPane().add(panel); AlignLeft=new JButton("Align Left"); AlignCenter=new JButton("Align Center"); AlignRight=new JButton("Align Right"); Resize=new JButton("Resize"); JPanel north=new JPanel(); JPanel south=new JPanel(); JLabel Width = new JLabel("Width: ",Label.RIGHT); JTextField txt = new JTextField(17); JLabel Height=new JLabel("Height: ", Label.RIGHT); JTextField TxT =new JTextField(17); north.add(AlignLeft); north.add(AlignCenter); north.add(AlignRight); south.add(Width); south.add(txt); south.add(Height); south.add(TxT); contentPane.add(north, BorderLayout.NORTH); contentPane.add(south,BorderLayout.SOUTH); south.setLayout(new GridLayout(3,2)); south.add(Resize); JMenuBar menuBar=new JMenuBar(); setJMenuBar(menuBar); JMenu optionMenu =new JMenu("Options"); menuBar.add(optionMenu); JMenuItem reset =new JMenuItem("Reset"); optionMenu.add(reset); add(panel); pack(); setVisible(true); } protected static ImageIcon createImageIcon(String path) { java.net.URL imgURL = Image.class.getResource(path); if (imgURL != null) { return new ImageIcon(imgURL); } else { System.err.println("Couldn't find file: " + path); return null; } } public static void main(String [] arguments){ Image i=new Image("Image Application."); } } I want to be able to press any button and do what is made for... Align Left move picture left Align Center move picture to the center Align Right move picture right Also in the text area i have to put the size of the picture and be able to change it by typing a new size and pressing the button Resize. PLEASE HELP (i am a beginner.... )
  2. but is this steps right? 36.65=20n => =>n=log2036.65
  3. i have this : 15,76=0.43*(20)n i have to calculate n... 15.76/0.43=20n 36.65=20n n=log2036.65 is this right???
  4. Simplify this Boolean expression : F(a,b,c)=((c+a)' *(c⊕b)')' My answer is:F= ((c'*a')*(cd+c'd'))'=(c'*a')'+(cd+c'd')'=c+a+(c'd'*cd)=c+a Is that right? If not explain?
  5. Simplify this Boolean expression please: F(a,b,c)=((c+a)' *(c⊕b)')' ⊕=XOR
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.