Free Essay

Import Java

In: Computers and Technology

Submitted By juneangel
Words 793
Pages 4
import java.awt.*; import java.awt.event.*; import javax.swing.*; class Calculator extends JFrame implements ActionListener
{
private static final long serialVersionUID = 1L; TextField txt=new TextField(15); JButton btn1 = new JButton("1"); JButton btn2 = new JButton("2"); JButton btn3 = new JButton("3"); JButton btn4 = new JButton("4"); JButton btn_arti = new JButton("+"); JButton btn5 = new JButton("5"); JButton btn6 = new JButton("6"); JButton btn7 = new JButton("7"); JButton btn8 = new JButton("8"); JButton btn_eksi = new JButton("-"); JButton btn9 = new JButton("9"); JButton btn0 = new JButton("0"); JButton btn_clr = new JButton("CLR"); JButton btn_carpi = new JButton("*"); JButton btn_bolu = new JButton("/"); JButton btn_esit = new JButton("="); String str_number = ""; int operation = 0; double int_number1 = 0; double int_number2 = 0; double result = 0; public Calculator() { JFrame frame = new JFrame("CALCULATOR"); frame.setSize(320,320); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setResizable(false); frame.setVisible(true); frame.setLayout(new BorderLayout()); JPanel HeadPanel = new JPanel(); JPanel NumberPanel = new JPanel(); JPanel LabelPanel = new JPanel(); LabelPanel.setBackground(Color.WHITE); HeadPanel.setBackground(Color.BLACK); NumberPanel.setLayout(new GridLayout(3,3)); LabelPanel.setLayout(new FlowLayout()); NumberPanel.add(btn1); btn1.addActionListener(this); NumberPanel.add(btn2); btn2.addActionListener(this); NumberPanel.add(btn3); btn3.addActionListener(this); NumberPanel.add(btn4); btn4.addActionListener(this); NumberPanel.add(btn_arti); btn_arti.addActionListener(this); NumberPanel.add(btn5); btn5.addActionListener(this); NumberPanel.add(btn6); btn6.addActionListener(this); NumberPanel.add(btn_eksi); btn_eksi.addActionListener(this); NumberPanel.add(btn7); btn7.addActionListener(this); NumberPanel.add(btn8); btn8.addActionListener(this); NumberPanel.add(btn_eksi); btn_eksi.addActionListener(this); NumberPanel.add(btn9); btn9.addActionListener(this); NumberPanel.add(btn0); btn0.addActionListener(this); NumberPanel.add(btn_clr); btn_clr.addActionListener(this); NumberPanel.add(btn_carpi); btn_carpi.addActionListener(this); NumberPanel.add(btn_bolu); btn_bolu.addActionListener(this); LabelPanel.add(new JLabel("NUMBER : ")); LabelPanel.add(txt); LabelPanel.add(btn_esit); btn_esit.addActionListener(this); txt.setEditable(true); frame.add(HeadPanel,BorderLayout.NORTH); frame.add(NumberPanel,BorderLayout.CENTER); frame.add(LabelPanel,BorderLayout.SOUTH); } public void actionPerformed(ActionEvent e)
{
if(e.getSource()==btn1) { txt.setText("1"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn2) { txt.setText("2"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn3) { txt.setText("3"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn4) { txt.setText("4"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn5) { txt.setText("5"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn6) { txt.setText("6"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn7) { txt.setText("7"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn8) { txt.setText("8"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn9) { txt.setText("9"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn0) { txt.setText("0"); str_number+=txt.getText(); txt.setText(str_number); } else if(e.getSource()==btn_arti) { if(operation==0 & str_number!="") { int_number1=Integer.parseInt(str_number); txt.setText("+"); str_number+=txt.getText(); txt.setText(str_number); operation=1;//TOPLAMA } else { txt.setText(str_number); }
}
else if(e.getSource()==btn_eksi) { if(operation==0 & str_number!="") { int_number1=Integer.parseInt(str_number); txt.setText("-"); str_number+=txt.getText(); txt.setText(str_number); operation=2; //ÇIKARTMA } else { txt.setText(str_number); } } else if(e.getSource()==btn_carpi) { if(operation==0 & str_number!="") { int_number1=Integer.parseInt(str_number); txt.setText("*"); str_number+=txt.getText(); txt.setText(str_number); operation=3; //ÇARPMA } else { txt.setText(str_number); } } else if(e.getSource()==btn_bolu) { if(operation==0 & str_number!="") { int_number1=Integer.parseInt(str_number); txt.setText("/"); str_number+=txt.getText(); txt.setText(str_number); operation=4; //BÖLME } else { txt.setText(str_number); } } else if(e.getSource()==btn_esit) { if(operation!=0 & str_number!="") { txt.setText("="); str_number+=txt.getText(); txt.setText(str_number); switch(operation) { case 1: { String[] kelime = null; kelime = str_number.split("\\+"); int_number2=Integer.parseInt(kelime[1].replace("=","")); result=int_number1+int_number2; txt.setText(str_number+Double.toString(result)); break; } case 2: { String[] kelime = null; kelime = str_number.split("\\-"); int_number2=Integer.parseInt(kelime[1].replace("=","")); result=int_number1-int_number2; txt.setText(str_number+Double.toString(result)); break; } case 3: { String[] kelime = null; kelime = str_number.split("\\*"); int_number2=Integer.parseInt(kelime[1].replace("=","")); result=int_number1*int_number2; txt.setText(str_number+Double.toString(result)); break; } case 4: { String[] kelime = null; kelime = str_number.split("\\/"); int_number2=Integer.parseInt(kelime[1].replace("=","")); result=int_number1/int_number2; txt.setText(str_number+Double.toString(result)); break; } } btn0.setEnabled(false); btn1.setEnabled(false); btn2.setEnabled(false); btn3.setEnabled(false); btn4.setEnabled(false); btn5.setEnabled(false); btn6.setEnabled(false); btn7.setEnabled(false); btn8.setEnabled(false); btn9.setEnabled(false); btn_arti.setEnabled(false); btn_eksi.setEnabled(false); btn_carpi.setEnabled(false); btn_bolu.setEnabled(false); btn_esit.setEnabled(false); } else { txt.setText("ERROR!!!"); } } else if(e.getSource()==btn_clr) { txt.setText(""); str_number = ""; operation = 0; int_number1 = 0; int_number2 = 0; result = 0; btn0.setEnabled(true); btn1.setEnabled(true); btn2.setEnabled(true); btn3.setEnabled(true); btn4.setEnabled(true); btn5.setEnabled(true); btn6.setEnabled(true); btn7.setEnabled(true); btn8.setEnabled(true); btn9.setEnabled(true); btn_arti.setEnabled(true); btn_eksi.setEnabled(true); btn_carpi.setEnabled(true); btn_bolu.setEnabled(true); btn_esit.setEnabled(true); } //else if(e.getSource()==btn_del) { // } } public static void main(String args[]){ new Calculator(); }
}

Similar Documents

Free Essay

Toys

...​We also waned to spot out that they imported more that half of its supply from the U.S (Johansson 184). Finding potential suppliers within Japan was something they didn’t think too much about and it became an issue. By importing large quantities of goods they would profit from the cheap dollar (Johansson 184) but they need to keep in mind that cheap land, cheap money, and cheap imports has to end at one point in time (Johansson 184). By finding local manufacturers/distributors then they will help the localization process and continue to stay own the retail market for leisure goods. ​As long as Toy’s “R” Us looks at the challenges they may be faced with for the future and they have a plan then we feel they will stay on top. Things Toy’s “R” Us needs to continue to be on the look out for are: competition, increasing cost, possible positioning problems, and the steady deterioration of the Japanese economy and consumer spending (Johansson 185). By being prepared and having a plan of action for all these setbacks they will be able to dominate the retail market in Japan. ​We feel that Toy’s “R” Us Japan had also made great decisions when entering the Japanese market. High barriers is something Toy’s “R” Us saw right away as a hurtle they had to get over. And to help them enter the country they decided on a joint-venture with McDonalds Japan with their 20%/80% relationship. In doing this joint-venture they were able to use McDonald’s successful international marketing......

Words: 383 - Pages: 2

Premium Essay

Strengthen E-Commerce Channels

...something, I’ll look on the local market first and then go onto the internet. If I can find it cheaper on the internet and I have a means such as the Visa Cards that allow people buy from outside. Even if it’s a car there would cars sitting at the car ranch but I’ll still import a car. Those car sellers have global competitors but they do not know and this is affecting their business” he said. “Also there are Ghanaians traditional goods and services that are so preferred by the Diaspora but we are unable to sell them abroad via online. Example is the Ghanaians fabrics and artifacts sold on the Osu Oxford street and other places. Imagine the foreigners who usually patronize these items find them online and import and receive them why cant that create a market for us” he addded. He adds that the more attention needs to be paid to the issue due to its implications for macro economic variables such as the exchange rate. “We have a traditional import and export regime which the experts would use to sort of determine our exchange rate. That is the theory that if we export more and import little our exchange rate would appreciate and the vice-versa” he stated. “But what do we see today? There is an aspect of import that we have not taken into consideration and that is the online where people are purchasing and...

Words: 377 - Pages: 2

Premium Essay

Factors to Consider During Importation Process

...(Date) (Instructor’s name) (Unit’s name) Factors to consider before importing. The term import is derived from the conceptual meaning as to bring in the goods and services into the port of a country. The buyer of such goods and services is referred to an importer who is based in the country of import. And in this case we are the importers. Some of the questions to consider are: Are there trade agreements? And with whom? This is one of the major factors to consider before carrying out the importation process. We will need to obtain market import information about the coffee beans in order to establish effective trade agreement with the right supplier. This information can be obtained from the internet, visiting potential markets and exhibitions and from established importers. After selecting the right supplier of the coffee beans establishment of trade agreements follows like placing the order and delivery of the goods through proper use of documents but before then we should ensure we have the trading license, import license and the import permit. Trade agreements are established with the supplier once he/she has also complied with the relevant regulations. Some of the trade agreements include: the method of payment, transfer of liabilities during transportation among others. This trade agreements are facilitated by the availability of International Commercial Terms which defines responsibilities regarding title, risks and costs, and eliminates possibilities...

Words: 841 - Pages: 4

Premium Essay

Solution of Alibaba Case

...Title: “Evolution of E-Business & Alibaba.com” Answer to the question number 1 Benefits of using sites like Alibaba.com • Cost effective way to do import & export business • This type of site is regarded as primary channel for getting information, sourcing goods or services, finding suppliers • This helps to expand the market reach and grow business • This type of site acts as an online global trade fair. • Helps small business to become independent importers & exporters. • Different types of costs are minimized here and thus, best product with fewer prices can be found. • Eliminates time constraint • Selection becomes easy from classified product list • This type of business spreads trade opportunities throughout the globe. Costs of using sites like Alibaba.com • To become registered user, yearly payment is mandatory • Only registered users can get details information about seller. • Certification enhances the authenticity and it requires money. The companies like Grieve can do bellowed things as an export strategy. • Create a website like Alibaba.com or get registered in Alibaba.com to reach international buyers. • Get certification from different sources and post that to Online. Answer to the question number 5 As E-commerce sites like Alibaba.com uses technology as the primary way to develop others import & export business, they need to be transparent and currently they are giving more focus on holding crystal clear image. To uphold this image,......

Words: 349 - Pages: 2

Premium Essay

Ibbl

...DOCUMENTARY CREDIT TRACKING SYSTEM OF IBBL An internship report submitted for the satisfaction of the requirements for the degree of BACHELOR OF BUSINESS ADMINISTRATION By S.M. Tanvir Ferdous Id: B033112 Department of Business Administration International Islamic University Chittagong, Dhaka Campus Spring 2008 -1- DOCUMENTARY CREDIT TRACKING SYSTEM OF IBBL An internship report submitted for the satisfaction of the requirements for the degree of BACHELOR OF BUSINESS ADMINISTRATION Submitted To Md. Shariful Haque Assistant Professor Prepared By S.M. Tanvir Ferdous Id: B033112 Date of Submission: January 5, 2008 Department of Business Administration International Islamic University Chittagong, Dhaka Campus -2- Letter of Transmittal January 5, 2008 Md. Shariful Haque Assistant Professor DBA, IIUC Dhaka Campus Subject: Submission of the Internship Report Dear Sir, I am glad to inform you that I have completed my internship report on “Documentary Credit Tracking System of IBBL”. I have gathered extensive knowledge while I was doing this report. Though there was some limitation and difficulties but I tried my level best to eliminate those limitations with your help and your guideline. Since this is my first full form of co-relational study, I tried my level best to finish this study as professional manure. I highly appreciate the opportunity to prepare this report. Yours sincerely, S.M. Tanvir......

Words: 15879 - Pages: 64

Premium Essay

Markets

...Question 4. The imports of products into a country cannot provide an accurate market potential of the product. The market potential of a product manufactured by a firm depends on the total demand of the product and the total supply of the market. One thing to take a look at is quantity demanded. The quantity demanded of any product by customers is not constant. It varies with the price of the product. For example a decrease in price usually increases the quantity demanded. When a new product enters a new market through importation there is an increase in its price. This is due to the additional costs of shipping the product from the country it was manufactured in and the import duty and other taxes imposed by the nation. Therefore, a company could be exporting a lot of products to a new market but be losing profit margins because of increased expenses. To estimate the market potential of a product it is essential to look at the actual customers are. Another thing to consider is why they want the product and how the price affects them. Another reason is that they may be making the product domestically. Even when basic need is identified, research look for current trade flows to see what level of activity is in place. Just because goods are currently imported doesn’t mean they will be imported in specific countries. Initial screening evaluated the basic need for a product or service in a specific market. It evaluates markets relevant to product......

Words: 536 - Pages: 3

Premium Essay

Discussion Board 1 Econ 214

...How Exports impact GDP Tiffany Cook March 19, 2015 Econ 214 (gwartney, 2015) “Gross domestic import is the market values of all final goods and sales” There are various factors that make up the subcategories of the United States, Gross domestic product. This definition tells us how we ultimately arrive at a calculations of the gross domestic products, but it does not shed light on the economies output and input and the benefits or setbacks each service may have. Some ways that we can look at expenditure approach is to know the wealth of what our goods and services can provide, also how these goods and services can be a come up or a setback dependent upon what we do more of. The expenditure approach allows us to see what our consumers have been benefiting from with the goods and services that have been provided to them by the US. Foreigners make up a portion of the GDP with imports, but in order for us to be on the winning side we would have to provide other countries with more of our products for them to buy or consume. Therefore the greatest impact on GDP is what we export in order to gain a profit from the consumer. If we were the consumer we would be looking to do the same. The economies main goal is to make the money and keep more of it. Exports allow us to do more of that, imports gives us resources to supply the source products for us to export. (Deekay, 2009)States that “export instability stimulates inflation. When inflation rises in a country the products......

Words: 559 - Pages: 3

Premium Essay

Duty Drawback to Boast Export

...and large-scale entrepreneurs have been contributing directly and indirectly to the growth further. And one of the key incentives provided by the government to exporters is duty drawback. To enable exports to flourish, the government has put in motion private sector-friendly policies and a number of supportive inducements. Exporters, among others, are allowed bonded warehouse facilities, cash incentive, and duty exemption and duty drawback facilities to make them profitable and remain competitive in export markets. Duty drawback refers to refund of duties and indirect taxes paid for inputs and utilities for exports. Import duties, VAT, supplementary duties and other duties paid on imported raw materials can be drawn back by firms under the duty drawback facility. The drawback facility is provided to exporters and deemed exporters of goods and services who import inputs or raw materials for the purpose of exportation only, after local value addition. But, only those who are not already enjoying bonded warehouse and cash incentive facilities are given this incentive. Firms may also get drawback on the fuel consumed at the stage of production. The duty...

Words: 1820 - Pages: 8

Premium Essay

The Japanese Yen Intervention of 2010

...spiked downward (more yen per dollar) for after a few days. No. There is no limit to its ability to intervene. Why is a stronger yen such a bad thing for japan? Isn't a stronger currency value an indication of confidence by the global markets in the economy and policies of a country? A stronger yen give a bad impact for the economic growth in Japan especially in exports. It effect if foreign buyer would find its exports more expensive. A strong yen make Japan’s products less competitive compared with the other rivals such as China. Lastly , a strong yen is not good for exporters because makes goods more expensive in other country and exports of goods become reduce. Not necessarily because at importers side it will forcing down import prices and drive exporters in bankruptcy. It means that indication of confidence and policies of country is not necessarily. If currency intervention has such a poor record, why do you think countries like Japan or Switzerland or Chile continue to do it? Although currency intervention has a poor record of these countries need to continue to achieve multiple objectives with overall control inflation, maintain...

Words: 346 - Pages: 2

Premium Essay

Ecuadorean Rose Industry

...Most of Ecuador's rose farms are located in Cayambe and Cotopaxi regions and are within an hour drive from Quito, the capital of Ecuador. The altitude is around 10,000 feet up and the rose farms are at the foot of volcanoes that rise more than 20,000 feet. The rose fields benefit from fertile soil, high altitude, and the intense sunlight that lasts up to 12 hours each day. The location close to the equator makes an ideal growing condition and the roses thrive. They have vibrant color and large heads. They are prime roses and fetch a premium price. Because of the location and conditions, the roses flower year round. All these are the basis of Ecuador’s comparative advantage in the production of roses. From the importation of Ecuadorean roses, people, company or organization who handle this business in of New York city of the United States and London city of Europe. Because they are selling the roses which are fresh, vibrant colored, including 10 different reds, from bleeding heart crimson to a rosy lover’s blush, for premium prices to people who lives in their city. Then sellers can get profit from differentiation between income which they got from selling and money which paid to Ecuadorean rose supplier. In the meantime, sellers who sell roses from their own country will be lost because they could not get and do business with fresh and fancy roses like Ecuadorean roses. Absolutely it is more beneficial both seller and demander as well supplier. Rose export industry......

Words: 454 - Pages: 2

Premium Essay

Long Term Growth Rate of Countries

...productivities and factor supplies to explain the different growth rate between countries that was not satisfactory. As the result, the differences could be explained by the constraints on demand; indeed, the balance of payment is the central constraint for an open economy. Then, the paper predicts that the growth rate can be examined by the relation between foreign countries’ rate of income expansion, which are the income elasticity of demand for export and the income elasticity of demand for imports (Grullon 2011). Moreover, the paper used developed countries as evidence to approximate the growth rate by using the balance of payment constraint growth model. The first argument of Thirlwall’s law lies on the constraint on demand instead of supply side, by explaining the differences in growth rate between countries. The paper (Thirlwall 1979) stated that under certain assumptions, a country’s growth rate is near to the rate of growth of export divided by the income elasticity of demand of import. More specifically, if a country has trading deficit, as it expands its demand. Yet, demand will reduce and supply will never in satisfactory. Then, the economy will suffer from the negative effect such as...

Words: 821 - Pages: 4

Premium Essay

Determining Causes and Effects

... The cause and effect characteristic establishes the action one takes in embarking on an issue. There is a reason for doing something which is escorted with some effects that is either optimistic or pessimistic. The pronouncement to import or use local materials is determined by the causes and effects related to it. This work explains the causes and effects of an automotive manufacturer importing from the international markets. It effects the decision of people and the economy. [pic] The demand to produce high quality and exceptional automotive materials is the major cause for importing from foreign markets. With lofty competition in the automotive industry, manufacturers exercise all means to guarantee that they fabricate the unsurpassed automotive products in the market. When the local materials will not allow them to produce high quality products, the next alternative is importing from international markets where they are readily obtainable (Hinkelman, 2004). The need to meet the demands for exported products causes the manufacturer(s) to import automotive materials from the international market. With escalating demands for automotive exported products, manufacturers are forced to import raw materials to guarantee there is adequate supply to meet the existing demands. It is the demand for a specific product or service that...

Words: 797 - Pages: 4

Premium Essay

Tim's Coffee Shoppe

...align with our country or what Tim may have to do in order to market his coffee appropriately as Tim would not want to have to keep his supplier a secret if a consumer asks where he gets his coffee from. The country I have chosen to buy coffee from would be Brazil. According to an article in Business Week, Brazil is the largest coffee producing country in the world (Businessweek.com). Brazil produces many different types of coffee beans and will potentially sell over 48.6 million bags of coffee in the year 2013 (businessweek.com). I have chose Brazil because since 1988 they have came a long way with environmental standards and also their trade policies when it comes to exporting goods. In 2011, Brazil was the U. S. largest source of imports and has many opportunities for growth for companies that want to do business in this country (export.gov). The Strauss Company located in Brazil would be the company I would use to get my coffee imported from. In 2000, the Strauss Company acquired Café Très Coracoes which is located in Brazil and in 2005 became the 2nd largest coffee company in Brazil (export.gov). This is the company I would chose do to the fact that they took a chance as well in the coffee market in Brazil and it paid off. This company knows what it takes to be successful and if you build a good relationship with them they could pass on...

Words: 908 - Pages: 4

Free Essay

The Beer Store

...Reflections and Insights: Ch 1 & 2 Part 1: Reflection of Chapter 1 (Week 1) 1. Some of the key point’s chapter one focuses on are, performing an internal analysis, indentifying potential markets and considering potential issues. Performing internal analysis outlines finding your strategic objectives, how capable you are of meeting these objectives and understanding your strengths and weaknesses. Indentifying potential markets is understanding your strategic objectives and figuring out how you can improve. These objectives include, maximizing profits, increasing market share, maximizing cash flow, repositioning the business and acquiring resources. When considering potential issues it is important to understand Porter’s five forces which are the threats of new entrants or barriers to entry, intensity of rivalry among existing competitors in the market, the threat posed by substitute products, the bargaining power of buyers and the bargaining power of suppliers. My strength in relation to this chapter is that I am open minded and search for unique ways to sell products and look for new markets. My weakness in relation to this course is that I don’t have the professional knowledge to jump into a new market. In the future I will apply all the knowledge I have learned in this chapter to my everyday life especially Porter’s five forces. When I’m not a school or work I am working on my band and if I relate this knowledge to my music I can be smarter and more knowledgeable......

Words: 455 - Pages: 2

Premium Essay

Sonic

...addressed, which are the taxes, building permits, imports, and business licenses. The tax rate Sonic would fall under would be the Residual Commercial Property tax rate which is 3.78%. This is where we would take the value of our property and multiple it buy the tax rate which would then give us how much we would need to pay. Also, since we are trying to build or reconstruct a building we would need to obtain a building permit. This is a formal permission from the City of Toronto to being construction. The Toronto building staff must review the plans to ensure that we comply with all the building codes, local zoning by-laws, and other regulations the city might need us to meet. The permit fee for this project would roughly cost $21.00. There would be no issues for Sonic to import goods since Canada does not put any major restrictions on agricultural and food products. This would make it easier to bring over processed meat and other foods. Lastly, in order to do business in Toronto we would be required to get a business license from the Municipal Licensing and Standards Division. We would need a business license so that we can follow all of the municipal by-laws. If Sonic does not want to import their goods there is a local manufacture in Toronto that will do it for them. The National Importers have been importing food products since 1947. They provide marketing and distribution solutions as well as helping a company import goods for a smaller price. In......

Words: 510 - Pages: 3