Muxammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti qarshi filiali


Генерацияни амалга ошириш ва объект кодини оптималлаш


Download 352.7 Kb.
bet9/9
Sana11.11.2021
Hajmi352.7 Kb.
#173574
1   2   3   4   5   6   7   8   9
Bog'liq
8-laboratoriya ishi

Генерацияни амалга ошириш ва объект кодини оптималлаш.
"Триадлар" вкладкасида триадаларни генерацияси ва уларни оптималлаш хакидаги маълумот чикарилади (14-расм). Берилган масала вариантига ортикча амалларни олиб ташланган оптималлаш мос келади. Унинг натижалари ва модулнинг тулик мантикий иши ушбу вкладкада курсатиади.

14 -расм – "Триадалар" вкладкаси


Триадаларни ассемблер кодига айлантириш натижалари алохида "Командалар" вкладкасида келтирилган (15 -расм). Ушбу натижалар барча дастурнинг иши натижалари хисобланади.

15-расм – "Командалар" вкладкаси

package filewrite;
import java.awt.FileDialog;

import java.io.*;

import java.util.logging.Level;

import java.util.logging.Logger;


public class writer extends javax.swing.JFrame {

public writer() {

initComponents();

}
@SuppressWarnings("unchecked")

//

private void initComponents() {


writebutton = new javax.swing.JButton();

jTextField1 = new javax.swing.JTextField();

jLabel1 = new javax.swing.JLabel();

jLabel2 = new javax.swing.JLabel();

jTextField2 = new javax.swing.JTextField();

jLabel3 = new javax.swing.JLabel();

jTextField3 = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
writebutton.setText("write");

writebutton.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

writebuttonActionPerformed(evt);

}

});
jTextField1.addActionListener(new java.awt.event.ActionListener() {



public void actionPerformed(java.awt.event.ActionEvent evt) {

jTextField1ActionPerformed(evt);

}

});
jLabel1.setText("Fayl nomi");


jLabel2.setText("O'lchami ");
jLabel3.setText("Sana");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(46, 46, 46)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel1)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)

.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))

.addGap(18, 18, 18)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)

.addComponent(jTextField1)

.addComponent(jTextField2)

.addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE)))

.addGroup(layout.createSequentialGroup()

.addGap(95, 95, 95)

.addComponent(writebutton)))

.addContainerGap(70, Short.MAX_VALUE))

);

layout.setVerticalGroup(



layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(33, 33, 33)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel1))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jLabel2)

.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jLabel3)

.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

.addGap(43, 43, 43)

.addComponent(writebutton)

.addContainerGap(53, Short.MAX_VALUE))

);
pack();

}//
private void writebuttonActionPerformed(java.awt.event.ActionEvent evt) {

try {


FileWriter wr=new FileWriter("D:/namuna.txt");

String str=jTextField1.getText()+"\n";

wr.write(str);

str=jTextField2.getText()+"\n";

wr.write(str);

str=jTextField3+"\n";

wr.write(str);

wr.close();

} catch (IOException ex) {

Logger.getLogger(writer.class.getName()).log(Level.SEVERE, null, ex);

}

}
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {



// TODO add your handling code here:

}
public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {



if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;

}

}



} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(writer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(writer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(writer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(writer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

}

//


java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new writer().setVisible(true);

}

});


}
// Variables declaration - do not modify

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JTextField jTextField1;

private javax.swing.JTextField jTextField2;

private javax.swing.JTextField jTextField3;

private javax.swing.JButton writebutton;



// End of variables declaration

}



Download 352.7 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling