Mohammad Alhawawsha: E-Government Online Voting System Project
VerifiedAdded on  2019/09/26
|34
|9196
|323
Project
AI Summary
This project proposes a Java-based e-government system designed to facilitate online voting. The paper begins with an abstract highlighting the system's purpose: to improve government-public interaction and service reach by enabling citizens to vote securely from any location and time, while ensuring privacy and preventing vote theft. The introduction explains the concept of e-government and its role in facilitating citizen engagement and the use of information and communication technology. The research aims to understand existing e-government systems and propose a new online voting system, assessing its merits and demerits. The paper reviews existing solutions for online voting and proposes a new system, including voter registration and login processes, to address challenges such as security and accessibility. The system aims to enable voting from home, reducing interruptions for citizens. The methodology involves secondary research, referencing various sources to gather information. The results section examines current e-governance models, service delivery, and adoption rates in different countries. It then presents a proposed Java-based online voting system with voter registration and login processes. The system stores voter information securely and facilitates secure voting. The project underscores the importance of trust, security, and citizen awareness in the successful implementation of e-government systems.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.

E-GOVERNMENT SYSTEM ONLINE VOTING SYSTEM
Mohammad Alhawawsha
Abstract
E-government systems are meant to improve the level of interaction of
government with the public and to improve the reach of services provided by the
government to the public. A java based e-government system has been suggested in
this paper that will allow the government to conduct online voting. It will ensure that
the individuals vote from their preferred location and time without getting concerned
about privacy and vote theft.
Keyword: E-government system, election, java, technology
1. Introduction
The current paper is concerned with understanding the various aspects of e-
government system. In addition, a new e-government system has been proposed that
is likely to support the government in handling the election polling. E-government
system refers to the use of electronic mediums to facilitate the services to the public
of the country (Becker et al, 2004).
The e-government system allows the citizen to engage with the government at
all the levels and along with gaining benefit from the actions of the government, it
contributes to the action of the government. With the use of e-government system, the
citizens involved in the local and national governance. The information and
communication technology is used to facilitate these actions. As per United Nations,
the e-government is referred to as the actions of the government that lead to the use
of information technology to facilitate the delivery of government services to the
citizens (Gil-Garcia and Pardo, 2005).
At present, the United Nations conducts e-government survey twice a year to
assess the readiness of the governments of different countries regarding the use of
information and technology to conduct their business and cater to the masses. As a
model, the e-government system should be able to allow any individual visiting the
city or country website to engage in communication with the employees of the local
government using the internet, GUI, and IM.
The current paper is concerned with understanding the current e-government
system and proposing an additional system that can aide in the current system. The
second chapter assesses the current e-government system and then proposes an
additional online system in the next chapter. Also, it identifies the potential merits
and limitations of the proposed online system.
2. The object of research and its technological audit
At present, due to the technological advancement, almost every household has
the access to the technology. This allows the government to implement technology
based solutions that can help in making the lives of the people simpler. At present, it
has been found that the people are required to stand in the line to vote for their
respective candidates. This leads to the challenging situation for government and the
Mohammad Alhawawsha
Abstract
E-government systems are meant to improve the level of interaction of
government with the public and to improve the reach of services provided by the
government to the public. A java based e-government system has been suggested in
this paper that will allow the government to conduct online voting. It will ensure that
the individuals vote from their preferred location and time without getting concerned
about privacy and vote theft.
Keyword: E-government system, election, java, technology
1. Introduction
The current paper is concerned with understanding the various aspects of e-
government system. In addition, a new e-government system has been proposed that
is likely to support the government in handling the election polling. E-government
system refers to the use of electronic mediums to facilitate the services to the public
of the country (Becker et al, 2004).
The e-government system allows the citizen to engage with the government at
all the levels and along with gaining benefit from the actions of the government, it
contributes to the action of the government. With the use of e-government system, the
citizens involved in the local and national governance. The information and
communication technology is used to facilitate these actions. As per United Nations,
the e-government is referred to as the actions of the government that lead to the use
of information technology to facilitate the delivery of government services to the
citizens (Gil-Garcia and Pardo, 2005).
At present, the United Nations conducts e-government survey twice a year to
assess the readiness of the governments of different countries regarding the use of
information and technology to conduct their business and cater to the masses. As a
model, the e-government system should be able to allow any individual visiting the
city or country website to engage in communication with the employees of the local
government using the internet, GUI, and IM.
The current paper is concerned with understanding the current e-government
system and proposing an additional system that can aide in the current system. The
second chapter assesses the current e-government system and then proposes an
additional online system in the next chapter. Also, it identifies the potential merits
and limitations of the proposed online system.
2. The object of research and its technological audit
At present, due to the technological advancement, almost every household has
the access to the technology. This allows the government to implement technology
based solutions that can help in making the lives of the people simpler. At present, it
has been found that the people are required to stand in the line to vote for their
respective candidates. This leads to the challenging situation for government and the
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

public as well. On one hand where the government is required to make improved
management of the voting, on the other the public are required to get away from their
daily course and stand in the line to vote. There is a necessity that a system is brought
in the picture that can resolve this challenge. Interestingly, due to the increased
adoption of technological devices by the public in the past decades, the
implementation of online system has become easier for the government, as long as it
is suitable and useful for all the concerned stakeholders.
3. The aim and objectives of research
The aim of the research is to come up with a suitable e-government system that
can assist the government in improve its voting.
The objectives of the research are:
- to understand the existing solutions available for voting
- to propose a new e-government voting system
- to assess the merits and demerits of the proposed system
4. Research of existing solutions of the problem
One can witness numerous researches that have been conducted regarding the
usage of technologies to facilitate in the elections (Mcclure et al, 2001; Kohno et al,
2004; Draper and Brown, 2004; Kennedy and Cutts, 2005). Some of these studies
have warned against the rapid adaptation of the technology as it can be challenging
for the stakeholders to get used to it. However, with the improved security measures,
the technologies can be a beneficial tool. The elections conducted in various countries
uses technologies in different way. As for instance, the election conducted in Florida
(United States) in 2000 used punch card voting system which was later adopted by
wide population. This new electronic voting system allows the voters to have a
government issued token or smartcard which they can take to the nearest voting
terminal in their locality and then swipe the card. The system also allows them to
make any changes if they want by entering pin. This has been considered appreciable
in comparison to the traditional method where the voters approach the voting booth to
cast their vote by first showing their voter id and proving who they are. On the other
hand, the direct recording electronic (DRE) voting system allows the users to have
quick voting experience with faster service. There are only few instances of adoption
of this system, as there are still countries where the method of voting is traditional
and cumbersome (Mercuri, 2002; Bederson et al, 2003). Here, it can be stated that
despite the DRE, the government are required to make arrangements for the voting
terminals. However, the goal should be to ensure that the voters do not need to leave
their home to vote and can vote from their comfort zone. This should be filled as it
will reduce the interruption for public who can vote from their comfort.
One of the important aspects to understand here is that the parties in the election
can get the benefit of the system if they identify any loopholes to utilize the system
flaw. The recent development has found that the governments of few countries have
adopted the usage of the DRE without considering or questioning the security of the
system which can be a fatal mistake. Here, it is necessary that a voting system that is
robust and secure is required to be developed (Stuart et al, 2004). The introduction of
end to end encryption can also improve the security of the system. The end to end
management of the voting, on the other the public are required to get away from their
daily course and stand in the line to vote. There is a necessity that a system is brought
in the picture that can resolve this challenge. Interestingly, due to the increased
adoption of technological devices by the public in the past decades, the
implementation of online system has become easier for the government, as long as it
is suitable and useful for all the concerned stakeholders.
3. The aim and objectives of research
The aim of the research is to come up with a suitable e-government system that
can assist the government in improve its voting.
The objectives of the research are:
- to understand the existing solutions available for voting
- to propose a new e-government voting system
- to assess the merits and demerits of the proposed system
4. Research of existing solutions of the problem
One can witness numerous researches that have been conducted regarding the
usage of technologies to facilitate in the elections (Mcclure et al, 2001; Kohno et al,
2004; Draper and Brown, 2004; Kennedy and Cutts, 2005). Some of these studies
have warned against the rapid adaptation of the technology as it can be challenging
for the stakeholders to get used to it. However, with the improved security measures,
the technologies can be a beneficial tool. The elections conducted in various countries
uses technologies in different way. As for instance, the election conducted in Florida
(United States) in 2000 used punch card voting system which was later adopted by
wide population. This new electronic voting system allows the voters to have a
government issued token or smartcard which they can take to the nearest voting
terminal in their locality and then swipe the card. The system also allows them to
make any changes if they want by entering pin. This has been considered appreciable
in comparison to the traditional method where the voters approach the voting booth to
cast their vote by first showing their voter id and proving who they are. On the other
hand, the direct recording electronic (DRE) voting system allows the users to have
quick voting experience with faster service. There are only few instances of adoption
of this system, as there are still countries where the method of voting is traditional
and cumbersome (Mercuri, 2002; Bederson et al, 2003). Here, it can be stated that
despite the DRE, the government are required to make arrangements for the voting
terminals. However, the goal should be to ensure that the voters do not need to leave
their home to vote and can vote from their comfort zone. This should be filled as it
will reduce the interruption for public who can vote from their comfort.
One of the important aspects to understand here is that the parties in the election
can get the benefit of the system if they identify any loopholes to utilize the system
flaw. The recent development has found that the governments of few countries have
adopted the usage of the DRE without considering or questioning the security of the
system which can be a fatal mistake. Here, it is necessary that a voting system that is
robust and secure is required to be developed (Stuart et al, 2004). The introduction of
end to end encryption can also improve the security of the system. The end to end

encryption has become a necessary tool for the current systems due to the increasing
security threats (Bannet et al, 2004; Boneh and Franklin, 2001; Clarkson et al, 2008).
5. Methods of research
The method of research used for the current paper is secondary. The researcher
referred to various secondary resources for the collection of the information that were
relevant to the study. The secondary research allows desk-based study of the required
research area. The study could have been taken further by conducting primary
research to gain more input for the required system, however due to the time
constraint, secondary research was preferred.
6. Research results
The current chapter assesses the current e-governance system keeping in view
the current position of various countries such as United States, United Kingdom, and
India. In general, there are four models of service delivery from the government.
They are from a government to the citizens, from a government to businesses
operating in the country, from one department of government to another, and from
the government to its employees.
The adoption rate of e-government system is different in the different parts of
the world. The developed economies such as The United States and The United
Kingdom have an appreciable rate of adoption in comparison to developing nations
like India. The developed nations also witnesses improved usage rate of the system
by the citizens whereas same can be found far below in the developing nations
(Altameen et al, 2006).
The improved usage of e-government system requires that the citizens of the
country are well aware of modern information and communication technology and
how to use them. If a government is willing to use the e-government system, then it is
important that an education drive should be facilitated that can educate the citizens
about the same. This will help them get the intended benefit from the system.
The governments can use the information and communication technologies to
improve their governance capability. The IT can be implemented in almost all aspects
of the government activities and all can be coordinated together to provide better
service to the masses. Also, the internet can help the government in establishing
better coordination among the departments and improving the internal and external
relations.
In general, when the discussion of e-government comes up, people think about
the internet which is appreciable as it is the only thing at present that should be
guiding all the technological adoption by the government. However, there also exists
e-government which is not based on the internet. The use of SMS, telephone, wireless
networks, smart cards, CCTV, and others are also on the premise of information and
technology and thus are also the integral part of the e-government system. However,
the definition of the e-government has not changed to something that allows inclusion
of citizens with the government and this can only be facilitated by the use of the
internet (Al-khamayseh et al, 2006).
security threats (Bannet et al, 2004; Boneh and Franklin, 2001; Clarkson et al, 2008).
5. Methods of research
The method of research used for the current paper is secondary. The researcher
referred to various secondary resources for the collection of the information that were
relevant to the study. The secondary research allows desk-based study of the required
research area. The study could have been taken further by conducting primary
research to gain more input for the required system, however due to the time
constraint, secondary research was preferred.
6. Research results
The current chapter assesses the current e-governance system keeping in view
the current position of various countries such as United States, United Kingdom, and
India. In general, there are four models of service delivery from the government.
They are from a government to the citizens, from a government to businesses
operating in the country, from one department of government to another, and from
the government to its employees.
The adoption rate of e-government system is different in the different parts of
the world. The developed economies such as The United States and The United
Kingdom have an appreciable rate of adoption in comparison to developing nations
like India. The developed nations also witnesses improved usage rate of the system
by the citizens whereas same can be found far below in the developing nations
(Altameen et al, 2006).
The improved usage of e-government system requires that the citizens of the
country are well aware of modern information and communication technology and
how to use them. If a government is willing to use the e-government system, then it is
important that an education drive should be facilitated that can educate the citizens
about the same. This will help them get the intended benefit from the system.
The governments can use the information and communication technologies to
improve their governance capability. The IT can be implemented in almost all aspects
of the government activities and all can be coordinated together to provide better
service to the masses. Also, the internet can help the government in establishing
better coordination among the departments and improving the internal and external
relations.
In general, when the discussion of e-government comes up, people think about
the internet which is appreciable as it is the only thing at present that should be
guiding all the technological adoption by the government. However, there also exists
e-government which is not based on the internet. The use of SMS, telephone, wireless
networks, smart cards, CCTV, and others are also on the premise of information and
technology and thus are also the integral part of the e-government system. However,
the definition of the e-government has not changed to something that allows inclusion
of citizens with the government and this can only be facilitated by the use of the
internet (Al-khamayseh et al, 2006).

One of the important things, however, to consider is that the use of e-
government system is different in various countries and it impacts the level of
equality. The countries, where fewer people are aware of the internet and technology,
such as India face a lack of equality. On one hand where the citizens who are aware
of IT, gains the benefit from the improved government communication, however, the
other part of the citizens who are still unaware of this aspect face challenge.
There are many such people who are homeless, have lower income and cannot
learn or purchase IT devices, or are living in the remotest of the locations where there
is no IT infrastructure. In such scenarios, it is difficult for the government to provide
benefit to these people directly with the use of e-government modules. Here, the
elementary step of the government would be to train these people about the new
technology and install right infrastructure (Chircu and Lee, 2005).
In addition to above, it is important that the citizens trust the e-government
model for whether it will perform as expected. Interestingly, the e-government
system is still in developing phase from the most developed economies to the
underdeveloped economies. Even countries like US and UK has not fully adopted e-
government mechanism due to various reasons.
6.1 Proposed E-Government System
The e-government system consists of various modules and infrastructures that
cater to different aspects of government functioning. The current chapter will propose
a new module to the current e-government system that is likely to assist the
government in getting more digitalized.
The system that is proposed is an online voting system for the elections. This
system is still in a debate that whether a government should adopt this method of
voting considering various challenges, such as identity manipulation, data theft, and
others.
The system that has been suggested is Java based system which will allow the
government to hold voting at the local or national level. The citizens will use this
system to enter their personal details and then cast their vote for their preferred
candidate. The image below shows the information that will be entered by the users
before they engage in voting.
government system is different in various countries and it impacts the level of
equality. The countries, where fewer people are aware of the internet and technology,
such as India face a lack of equality. On one hand where the citizens who are aware
of IT, gains the benefit from the improved government communication, however, the
other part of the citizens who are still unaware of this aspect face challenge.
There are many such people who are homeless, have lower income and cannot
learn or purchase IT devices, or are living in the remotest of the locations where there
is no IT infrastructure. In such scenarios, it is difficult for the government to provide
benefit to these people directly with the use of e-government modules. Here, the
elementary step of the government would be to train these people about the new
technology and install right infrastructure (Chircu and Lee, 2005).
In addition to above, it is important that the citizens trust the e-government
model for whether it will perform as expected. Interestingly, the e-government
system is still in developing phase from the most developed economies to the
underdeveloped economies. Even countries like US and UK has not fully adopted e-
government mechanism due to various reasons.
6.1 Proposed E-Government System
The e-government system consists of various modules and infrastructures that
cater to different aspects of government functioning. The current chapter will propose
a new module to the current e-government system that is likely to assist the
government in getting more digitalized.
The system that is proposed is an online voting system for the elections. This
system is still in a debate that whether a government should adopt this method of
voting considering various challenges, such as identity manipulation, data theft, and
others.
The system that has been suggested is Java based system which will allow the
government to hold voting at the local or national level. The citizens will use this
system to enter their personal details and then cast their vote for their preferred
candidate. The image below shows the information that will be entered by the users
before they engage in voting.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

Figure 1: Voter Registration Process
The information will be stored in the government database and will not be
shared with any third party. The current system will store a name of the voter, his
unique voterID, password, phone number of the voter, address of the voter, date of
birth, and nationality. The aforementioned information will be used to identify
particular voters when they will cast their vote.
The registration will generate unique username and password that will be used
by the voter to log in to the system using the below window:
Figure 2: User Login Window
When users will enter their name (username) and password, then the system will
take them to the voting page where the users will see the list of candidates who prefer
to be elected in the particular election. The users will select a particular candidate and
submit their vote.
The system will ask for the confirmation from the users regarding their vote and
the voting will be completed. The users can then log out of the system after casting
The information will be stored in the government database and will not be
shared with any third party. The current system will store a name of the voter, his
unique voterID, password, phone number of the voter, address of the voter, date of
birth, and nationality. The aforementioned information will be used to identify
particular voters when they will cast their vote.
The registration will generate unique username and password that will be used
by the voter to log in to the system using the below window:
Figure 2: User Login Window
When users will enter their name (username) and password, then the system will
take them to the voting page where the users will see the list of candidates who prefer
to be elected in the particular election. The users will select a particular candidate and
submit their vote.
The system will ask for the confirmation from the users regarding their vote and
the voting will be completed. The users can then log out of the system after casting

their vote. This will be the whole procedure of the new online voting system from the
users’ (voters) end.
In addition to the above, the new system will also allow the admin to view the
votes cast in a graphical manner. This will allow easy viewing of the votes. The
system will allow the admin to view the data in three human readable formats for the
total casted votes. The first will be a summary of the votes cast in the form of a table.
The sample is shown in the figure below:
Figure 3: Voter Results Summary
Here, the admin will be able to view the parties for whom the vote was cast, a
total number of votes cast for each of the parties, and the same value in the form of
the percentage. This will allow the admin to understand the winner and the loser.
Another format that will be used to show the data is pie chart and the bar chart.
The snapshot of pie chart generated from the sample data is given below:
users’ (voters) end.
In addition to the above, the new system will also allow the admin to view the
votes cast in a graphical manner. This will allow easy viewing of the votes. The
system will allow the admin to view the data in three human readable formats for the
total casted votes. The first will be a summary of the votes cast in the form of a table.
The sample is shown in the figure below:
Figure 3: Voter Results Summary
Here, the admin will be able to view the parties for whom the vote was cast, a
total number of votes cast for each of the parties, and the same value in the form of
the percentage. This will allow the admin to understand the winner and the loser.
Another format that will be used to show the data is pie chart and the bar chart.
The snapshot of pie chart generated from the sample data is given below:

Figure 4: Voter Result Summary in Pie Chart
Here, in the above pie chart, the admin can visually understand the party to
whom the maximum number of votes has been cast. The figure below shows the
same data in the form of bar graph:
Here, in the above pie chart, the admin can visually understand the party to
whom the maximum number of votes has been cast. The figure below shows the
same data in the form of bar graph:
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Figure 5: Voter Result Summary in Bar Graph
Here, the bar graph above shows the total votes cast to the different parties. The
size of the bar graph will show which candidate has won or lost.
These visuals will help the system admin in knowing about the winners and the
losers. The appendix at the bottom of this paper shows the java codes utilized to
facilitate the development of this system. The codes were substantial in size and,
therefore, only certain aspects of them have been shown under different headings.
6.3 Benefits of Proposed E-Government System
The proposed system will allow the government to get votes from the citizens
without arranging booths to cast their vote. This will significantly reduce the cost
incurred in conducting voting across the country every few years. Moreover, this
system will allow the voters to cast their vote any time of the day they want and that
too without lining up at the voting booths.
The secure login id of the voters will be used by them to log into the system and
cast their vote as per their desire and comfort level. The new system will securely
transfer all the votes to the central database instantly with the help of end to end
encryption.
6.4 Limitations of Proposed E-Government System
The new system is still in the development stage and there are various aspects
that are required to be developed to make it more robust and usable to the
government. The current system is less secure and usable to the government and the
public.
Here, the bar graph above shows the total votes cast to the different parties. The
size of the bar graph will show which candidate has won or lost.
These visuals will help the system admin in knowing about the winners and the
losers. The appendix at the bottom of this paper shows the java codes utilized to
facilitate the development of this system. The codes were substantial in size and,
therefore, only certain aspects of them have been shown under different headings.
6.3 Benefits of Proposed E-Government System
The proposed system will allow the government to get votes from the citizens
without arranging booths to cast their vote. This will significantly reduce the cost
incurred in conducting voting across the country every few years. Moreover, this
system will allow the voters to cast their vote any time of the day they want and that
too without lining up at the voting booths.
The secure login id of the voters will be used by them to log into the system and
cast their vote as per their desire and comfort level. The new system will securely
transfer all the votes to the central database instantly with the help of end to end
encryption.
6.4 Limitations of Proposed E-Government System
The new system is still in the development stage and there are various aspects
that are required to be developed to make it more robust and usable to the
government. The current system is less secure and usable to the government and the
public.

There are some demerits to the current system also. The use of current system
requires that the voters know how to cast their votes through this system. In addition
to this, there are other prerequisites such as the users should be able to operate
computers, access internet, open browser, and establish the connection.
7. SWOT analysis of research results
The current section will look into the strength, weakness, opportunities, and
threats for the system.
- Strengths: The current system will allow the government to conduct online
elections. It will be easier for the government to conduct the election without
engaging extra resources. The system will allow the voters to vote securely
with end to end encryption.
- Weaknesses: The current system is in its development stage and the
implementation of the system will require robust security measures and it is a
mission critical system and can attract external challenges.
- Opportunities: The new system will likely open opportunities in other
governmental department at smaller to larger scale to conduct the voting. The
use of the system is likely to increase.
- Threats: The threats are in the form of hackers who might try to infiltrate the
system to steal the voter data.
8. Conclusion
The use of e-government system is likely to improve if the governments of
various countries make effort to educate their population. The use of e-government
system will help in the easy management of most of the governmental activities and
also facilitate the successful interaction with the citizens.
The current paper proposed an online voting system that is expected to be used
by the government to conducting voting. The voters will cast votes by logging into
the system which will be then summarized by the system automatically in the form of
a table, pie chart and bar chart to know the result of the election.
9. References
[1] Al-khamayseh, S., Lawrence, E. and Zmijewska, A., 2006, December.
Towards understanding success factors in interactive mobile government. In the
Proceedings of Euro mGov.
[2] Altameem, T., Zairi, M. and Alshawi, S., 2006, November. Critical success
factors of e-government: A proposed model for e-government implementation.
In Innovations in Information Technology, 2006 (pp. 1-5). IEEE.
[3] Becker, J., Niehaves, B., Algermissen, L., Delfmann, P. and Falk, T., 2004.
E-government success factors. Electronic Government, pp.503-506.
[4] Chircu, A.M. and Lee, D.H.D., 2005. E-government: key success factors for
value discovery and realisation. Electronic Government, an International
Journal, 2(1), pp.11-25.
requires that the voters know how to cast their votes through this system. In addition
to this, there are other prerequisites such as the users should be able to operate
computers, access internet, open browser, and establish the connection.
7. SWOT analysis of research results
The current section will look into the strength, weakness, opportunities, and
threats for the system.
- Strengths: The current system will allow the government to conduct online
elections. It will be easier for the government to conduct the election without
engaging extra resources. The system will allow the voters to vote securely
with end to end encryption.
- Weaknesses: The current system is in its development stage and the
implementation of the system will require robust security measures and it is a
mission critical system and can attract external challenges.
- Opportunities: The new system will likely open opportunities in other
governmental department at smaller to larger scale to conduct the voting. The
use of the system is likely to increase.
- Threats: The threats are in the form of hackers who might try to infiltrate the
system to steal the voter data.
8. Conclusion
The use of e-government system is likely to improve if the governments of
various countries make effort to educate their population. The use of e-government
system will help in the easy management of most of the governmental activities and
also facilitate the successful interaction with the citizens.
The current paper proposed an online voting system that is expected to be used
by the government to conducting voting. The voters will cast votes by logging into
the system which will be then summarized by the system automatically in the form of
a table, pie chart and bar chart to know the result of the election.
9. References
[1] Al-khamayseh, S., Lawrence, E. and Zmijewska, A., 2006, December.
Towards understanding success factors in interactive mobile government. In the
Proceedings of Euro mGov.
[2] Altameem, T., Zairi, M. and Alshawi, S., 2006, November. Critical success
factors of e-government: A proposed model for e-government implementation.
In Innovations in Information Technology, 2006 (pp. 1-5). IEEE.
[3] Becker, J., Niehaves, B., Algermissen, L., Delfmann, P. and Falk, T., 2004.
E-government success factors. Electronic Government, pp.503-506.
[4] Chircu, A.M. and Lee, D.H.D., 2005. E-government: key success factors for
value discovery and realisation. Electronic Government, an International
Journal, 2(1), pp.11-25.

[5] Gil-GarcÃa, J.R. and Pardo, T.A., 2005. E-government success factors:
Mapping practical tools to theoretical foundations. Government information
quarterly, 22(2), pp.187-216.
[6] Mcclure, N. and Lohry, K., MCCLURE NEIL and LOHRY KERMIT,
2001. Electronic voting system. U.S. Patent 6,250,548.
[7] Kohno, T., Stubblefield, A., Rubin, A.D. and Wallach, D.S., 2004, May.
Analysis of an electronic voting system. In Security and Privacy, 2004. Proceedings.
2004 IEEE Symposium on (pp. 27-40). IEEE.
[8] Draper, S.W. and Brown, M.I., 2004. Increasing interactivity in lectures
using an electronic voting system. Journal of computer assisted learning, 20(2),
pp.81-94.
[9] Kennedy, G.E. and Cutts, Q.I., 2005. The association between students' use
of an electronic voting system and their learning outcomes. Journal of Computer
Assisted Learning, 21(4), pp.260-268.
[10] Stuart, S.A., Brown, M.I. and Draper, S.W., 2004. Using an electronic
voting system in logic lectures: one practitioner's application. Journal of Computer
Assisted Learning, 20(2), pp.95-102.
[11] Mercuri, R., 2002. A better ballot box?. IEEE spectrum, 39(10), pp.46-50.
[12] Bederson, B.B., Lee, B., Sherman, R.M., Herrnson, P.S. and Niemi, R.G.,
2003, April. Electronic voting system usability issues. In Proceedings of the SIGCHI
conference on Human factors in computing systems (pp. 145-152). ACM.
[13] Bannet, J., Price, D.W., Rudys, A., Singer, J. and Wallach, D.S., 2004.
Hack-a-vote: Security issues with electronic voting systems. IEEE Security &
Privacy, 2(1), pp.32-37.
[14] Boneh, D. and Franklin, M., 2001, August. Identity-based encryption from
the Weil pairing. In Annual International Cryptology Conference (pp. 213-229).
Springer Berlin Heidelberg.
[15] Clarkson, M.R., Chong, S. and Myers, A.C., 2008, May. Civitas: Toward a
secure voting system. In Security and Privacy, 2008. SP 2008. IEEE Symposium
on (pp. 354-368). IEEE.
Summary of the article
The current paper was focused on proposing a new electronic voting system that
will assist the government in conducting the online voting for the elections. The
system will be secure with the end to end encryption to ensure that no data theft
occurs during the transfer. The key demerit of the system is the security from the end
of the government. It has to be ensured that all the external threats are kept at bay
when using the online voting system. The secondary research approach was
considered to mine the information required to conduct the study and develop the
system. Overall, it can be stated that the new system will allow the government and
public to have improved voting experience if implemented successfully.
Appendix
Mapping practical tools to theoretical foundations. Government information
quarterly, 22(2), pp.187-216.
[6] Mcclure, N. and Lohry, K., MCCLURE NEIL and LOHRY KERMIT,
2001. Electronic voting system. U.S. Patent 6,250,548.
[7] Kohno, T., Stubblefield, A., Rubin, A.D. and Wallach, D.S., 2004, May.
Analysis of an electronic voting system. In Security and Privacy, 2004. Proceedings.
2004 IEEE Symposium on (pp. 27-40). IEEE.
[8] Draper, S.W. and Brown, M.I., 2004. Increasing interactivity in lectures
using an electronic voting system. Journal of computer assisted learning, 20(2),
pp.81-94.
[9] Kennedy, G.E. and Cutts, Q.I., 2005. The association between students' use
of an electronic voting system and their learning outcomes. Journal of Computer
Assisted Learning, 21(4), pp.260-268.
[10] Stuart, S.A., Brown, M.I. and Draper, S.W., 2004. Using an electronic
voting system in logic lectures: one practitioner's application. Journal of Computer
Assisted Learning, 20(2), pp.95-102.
[11] Mercuri, R., 2002. A better ballot box?. IEEE spectrum, 39(10), pp.46-50.
[12] Bederson, B.B., Lee, B., Sherman, R.M., Herrnson, P.S. and Niemi, R.G.,
2003, April. Electronic voting system usability issues. In Proceedings of the SIGCHI
conference on Human factors in computing systems (pp. 145-152). ACM.
[13] Bannet, J., Price, D.W., Rudys, A., Singer, J. and Wallach, D.S., 2004.
Hack-a-vote: Security issues with electronic voting systems. IEEE Security &
Privacy, 2(1), pp.32-37.
[14] Boneh, D. and Franklin, M., 2001, August. Identity-based encryption from
the Weil pairing. In Annual International Cryptology Conference (pp. 213-229).
Springer Berlin Heidelberg.
[15] Clarkson, M.R., Chong, S. and Myers, A.C., 2008, May. Civitas: Toward a
secure voting system. In Security and Privacy, 2008. SP 2008. IEEE Symposium
on (pp. 354-368). IEEE.
Summary of the article
The current paper was focused on proposing a new electronic voting system that
will assist the government in conducting the online voting for the elections. The
system will be secure with the end to end encryption to ensure that no data theft
occurs during the transfer. The key demerit of the system is the security from the end
of the government. It has to be ensured that all the external threats are kept at bay
when using the online voting system. The secondary research approach was
considered to mine the information required to conduct the study and develop the
system. Overall, it can be stated that the new system will allow the government and
public to have improved voting experience if implemented successfully.
Appendix
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

Server Side
Pie graph
package ServerSide;
import java.awt.*;
import java.util.Map;
import java.util.TreeMap;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.lang.*;
import javax.swing.JPanel;
import java.sql.*;
class Piegraph extends JFrame {
PiegraphBuild pie1;
public Piegraph() {
buildWindow();
}
protected void buildWindow() {
Container con=getContentPane();
pie1=new PiegraphBuild();
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
con.add(pie1);
setTitle("PIE-CHART");
setSize(800,600);
setVisible(true);
}
public static void main(String []args) {
new Piegraph();
}
Pie graph
package ServerSide;
import java.awt.*;
import java.util.Map;
import java.util.TreeMap;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.lang.*;
import javax.swing.JPanel;
import java.sql.*;
class Piegraph extends JFrame {
PiegraphBuild pie1;
public Piegraph() {
buildWindow();
}
protected void buildWindow() {
Container con=getContentPane();
pie1=new PiegraphBuild();
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
con.add(pie1);
setTitle("PIE-CHART");
setSize(800,600);
setVisible(true);
}
public static void main(String []args) {
new Piegraph();
}

}
class PiegraphBuild extends JPanel
{
Connection con;
Statement stmt;
ResultSet rs;
String sql,sql1;
private Map<String,Integer> pieData;
PiegraphBuild()
{
pieData = new TreeMap<String,Integer>();
getConnection();
initializeData();
setBackground(Color.white);
}
///////////////////////getdata///////////////////////
protected void getConnection()
{
System.out.println("DataBase is connected");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:voting");
}
catch(Exception e)
{
System.out.println("JDBC:ODBC driver failed to load.");
return;
}
try
{
stmt = con.createStatement();
}
class PiegraphBuild extends JPanel
{
Connection con;
Statement stmt;
ResultSet rs;
String sql,sql1;
private Map<String,Integer> pieData;
PiegraphBuild()
{
pieData = new TreeMap<String,Integer>();
getConnection();
initializeData();
setBackground(Color.white);
}
///////////////////////getdata///////////////////////
protected void getConnection()
{
System.out.println("DataBase is connected");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:voting");
}
catch(Exception e)
{
System.out.println("JDBC:ODBC driver failed to load.");
return;
}
try
{
stmt = con.createStatement();
}

catch(Exception e)
{
e.printStackTrace();
return;
}
}
/////////////////////////////////////
//*************** To Initialize the Object
*************************************//
protected void initializeData() {
try {
sql="select * from Result";
stmt = con.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next())
{
String s1=rs.getString(2);
int n=Integer.parseInt(rs.getString(4));
pieData.put(s1,n);
}
}
catch(SQLException e)
{
System.out.println("fgsdgsg");
}
}
int Tvotes ;
double percentage;
{
e.printStackTrace();
return;
}
}
/////////////////////////////////////
//*************** To Initialize the Object
*************************************//
protected void initializeData() {
try {
sql="select * from Result";
stmt = con.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next())
{
String s1=rs.getString(2);
int n=Integer.parseInt(rs.getString(4));
pieData.put(s1,n);
}
}
catch(SQLException e)
{
System.out.println("fgsdgsg");
}
}
int Tvotes ;
double percentage;
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

int Vote1,Vote,Iangle=90,n=0;
int color1=25 ,color2=50,color3=75,X_axixs=80;
public void paintComponent(Graphics g)
{
super.paintComponents(g);
Set<String> keySet = pieData.keySet();
Iterator<String> keyIterator = keySet.iterator();
while(keyIterator.hasNext()) //To Get
the Total Number Of Votes
{
String partyName = keyIterator.next();
pieData.get(partyName);
Vote1 = pieData.get(partyName);
Tvotes=Tvotes+Vote1;
//Formula For Total Number of Votes
}
Set<String> keySet1 = pieData.keySet();
Iterator<String> keyIterator1 = keySet1.iterator();
while(keyIterator1.hasNext())
//To Calculate the Degrees & Draw the Pie Diagram.
{
double Tvotes2=(double)Tvotes;
String partyName1 = keyIterator1.next();
pieData.get(partyName1);
//For Accessing the Partyname from Mapped Set
System.out.println(partyName1);
Vote = pieData.get(partyName1);
//For Accessing the Votes of Parties from Mapped Set
System.out.println("Vote \t" +Vote);
System.out.println("Total Votes \t" +Tvotes2);
percentage=(Vote/Tvotes2)*100;
//To Calculate the Percentage of Votes.
System.out.println("Percentage \t" +percentage);
double deg1=(percentage/100)*360; //To
Calculate the Degrees from Percentage of Votes.
int degree1=(int) deg1;
System.out.println("DEGREE \t\t"+degree1);
n=n+1;
if(n==1)
int color1=25 ,color2=50,color3=75,X_axixs=80;
public void paintComponent(Graphics g)
{
super.paintComponents(g);
Set<String> keySet = pieData.keySet();
Iterator<String> keyIterator = keySet.iterator();
while(keyIterator.hasNext()) //To Get
the Total Number Of Votes
{
String partyName = keyIterator.next();
pieData.get(partyName);
Vote1 = pieData.get(partyName);
Tvotes=Tvotes+Vote1;
//Formula For Total Number of Votes
}
Set<String> keySet1 = pieData.keySet();
Iterator<String> keyIterator1 = keySet1.iterator();
while(keyIterator1.hasNext())
//To Calculate the Degrees & Draw the Pie Diagram.
{
double Tvotes2=(double)Tvotes;
String partyName1 = keyIterator1.next();
pieData.get(partyName1);
//For Accessing the Partyname from Mapped Set
System.out.println(partyName1);
Vote = pieData.get(partyName1);
//For Accessing the Votes of Parties from Mapped Set
System.out.println("Vote \t" +Vote);
System.out.println("Total Votes \t" +Tvotes2);
percentage=(Vote/Tvotes2)*100;
//To Calculate the Percentage of Votes.
System.out.println("Percentage \t" +percentage);
double deg1=(percentage/100)*360; //To
Calculate the Degrees from Percentage of Votes.
int degree1=(int) deg1;
System.out.println("DEGREE \t\t"+degree1);
n=n+1;
if(n==1)

g.setColor(Color.BLACK);
if(n==2)
g.setColor(Color.ORANGE);
if(n==3)
g.setColor(Color.BLUE);
if(n==4)
g.setColor(Color.DARK_GRAY);
if(n==5)
g.setColor(Color.RED);
if(n==6)
g.setColor(Color.PINK);
if(n==7)
g.setColor(Color.GREEN);
if(n>8)
{
Color color4=new Color(color1,color2,color3);
g.setColor(color4);
}
g.drawString(partyName1,X_axixs,500);
//For Printing the Party Names of Respective Pie-Diagram.
X_axixs=X_axixs+80;
g.fillArc(300,200,201,201,Iangle,degree1); //For
Drawing the Pie Diagram of Respective Political Parties.
Iangle=Iangle+degree1;
color1=color1+25;
//For Filling the Pie-Diagram with Different Colors Shades.
color2=color2+25;
color3=color3+25;
System.out.println("\n\n");
}
String label="PIE-CHART";
Font font=new Font("ArialBlack",Font.ITALIC,20);
g.drawRect(30,50,720,460);
g.setColor(Color.black);
g.setFont(font);
g.drawString(label,360,150);
}
}
Candidates
if(ae.getSource()==storeEditBtn[1]) {
if(n==2)
g.setColor(Color.ORANGE);
if(n==3)
g.setColor(Color.BLUE);
if(n==4)
g.setColor(Color.DARK_GRAY);
if(n==5)
g.setColor(Color.RED);
if(n==6)
g.setColor(Color.PINK);
if(n==7)
g.setColor(Color.GREEN);
if(n>8)
{
Color color4=new Color(color1,color2,color3);
g.setColor(color4);
}
g.drawString(partyName1,X_axixs,500);
//For Printing the Party Names of Respective Pie-Diagram.
X_axixs=X_axixs+80;
g.fillArc(300,200,201,201,Iangle,degree1); //For
Drawing the Pie Diagram of Respective Political Parties.
Iangle=Iangle+degree1;
color1=color1+25;
//For Filling the Pie-Diagram with Different Colors Shades.
color2=color2+25;
color3=color3+25;
System.out.println("\n\n");
}
String label="PIE-CHART";
Font font=new Font("ArialBlack",Font.ITALIC,20);
g.drawRect(30,50,720,460);
g.setColor(Color.black);
g.setFont(font);
g.drawString(label,360,150);
}
}
Candidates
if(ae.getSource()==storeEditBtn[1]) {

SetEditable(1);
candNameArray[1] =canName[1].getText();
candDscArray[1] = canDsc[1].getText();
System.out.println(candNameArray[1]);
}
if(ae.getSource()==storeEditBtn[2]) {
SetEditable(2);
candNameArray[2] =canName[2].getText();
candDscArray[2] = canDsc[2].getText();
System.out.println(candNameArray[2]);
}
if(ae.getSource()==storeEditBtn[3]) {
SetEditable(3);
candNameArray[3] =canName[3].getText();
candDscArray[3] = canDsc[3].getText();
System.out.println(candNameArray[3]);
}
if(ae.getSource()==storeEditBtn[4]) {
SetEditable(4);
candNameArray[4] =canName[4].getText();
candDscArray[4] = canDsc[4].getText();
System.out.println(candNameArray[4]);
}
if(ae.getSource()==storeEditBtn[5]) {
SetEditable(5);
candNameArray[5] =canName[5].getText();
candDscArray[5] = canDsc[5].getText();
System.out.println(candNameArray[5]);
}
if(ae.getSource()==storeEditBtn[6]) {
SetEditable(6);
candNameArray[6] =canName[6].getText();
candDscArray[6] = canDsc[6].getText();
System.out.println(candNameArray[6]);
}
if(ae.getSource()==storeEditBtn[7]) {
SetEditable(7);
candNameArray[7] =canName[7].getText();
candDscArray[7] = canDsc[7].getText();
candNameArray[1] =canName[1].getText();
candDscArray[1] = canDsc[1].getText();
System.out.println(candNameArray[1]);
}
if(ae.getSource()==storeEditBtn[2]) {
SetEditable(2);
candNameArray[2] =canName[2].getText();
candDscArray[2] = canDsc[2].getText();
System.out.println(candNameArray[2]);
}
if(ae.getSource()==storeEditBtn[3]) {
SetEditable(3);
candNameArray[3] =canName[3].getText();
candDscArray[3] = canDsc[3].getText();
System.out.println(candNameArray[3]);
}
if(ae.getSource()==storeEditBtn[4]) {
SetEditable(4);
candNameArray[4] =canName[4].getText();
candDscArray[4] = canDsc[4].getText();
System.out.println(candNameArray[4]);
}
if(ae.getSource()==storeEditBtn[5]) {
SetEditable(5);
candNameArray[5] =canName[5].getText();
candDscArray[5] = canDsc[5].getText();
System.out.println(candNameArray[5]);
}
if(ae.getSource()==storeEditBtn[6]) {
SetEditable(6);
candNameArray[6] =canName[6].getText();
candDscArray[6] = canDsc[6].getText();
System.out.println(candNameArray[6]);
}
if(ae.getSource()==storeEditBtn[7]) {
SetEditable(7);
candNameArray[7] =canName[7].getText();
candDscArray[7] = canDsc[7].getText();
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

System.out.println(candNameArray[7]);
}
if(ae.getSource()==storeEditBtn[8]) {
SetEditable(8);
candNameArray[8] =canName[8].getText();
candDscArray[8] = canDsc[8].getText();
System.out.println(candNameArray[8]);
}
if(ae.getSource()==storeEditBtn[9]) {
SetEditable(9);
candNameArray[9] =canName[9].getText();
candDscArray[9] = canDsc[9].getText();
System.out.println(candNameArray[9]);
}
} /* End of Action Performed*/
} /* End of main Class*/
Client Side
Login
public class Login extends JFrame implements ActionListener
{
JLabel name, pass;
JTextField nameText;
JPasswordField passText;
JButton login, end;
static int attempt=0;
public Login()
{
name = new JLabel("Name:",JLabel.RIGHT);
pass = new JLabel("Password:",JLabel.RIGHT);
nameText = new JTextField(20);
passText = new JPasswordField(20);
login = new JButton("Login");
end = new JButton("End");
login.addActionListener(this);
end.addActionListener(this);
Container c = getContentPane();
c.setLayout(new GridLayout(3,2));
}
if(ae.getSource()==storeEditBtn[8]) {
SetEditable(8);
candNameArray[8] =canName[8].getText();
candDscArray[8] = canDsc[8].getText();
System.out.println(candNameArray[8]);
}
if(ae.getSource()==storeEditBtn[9]) {
SetEditable(9);
candNameArray[9] =canName[9].getText();
candDscArray[9] = canDsc[9].getText();
System.out.println(candNameArray[9]);
}
} /* End of Action Performed*/
} /* End of main Class*/
Client Side
Login
public class Login extends JFrame implements ActionListener
{
JLabel name, pass;
JTextField nameText;
JPasswordField passText;
JButton login, end;
static int attempt=0;
public Login()
{
name = new JLabel("Name:",JLabel.RIGHT);
pass = new JLabel("Password:",JLabel.RIGHT);
nameText = new JTextField(20);
passText = new JPasswordField(20);
login = new JButton("Login");
end = new JButton("End");
login.addActionListener(this);
end.addActionListener(this);
Container c = getContentPane();
c.setLayout(new GridLayout(3,2));

c.add(name);
c.add(nameText);
c.add(pass);
c.add(passText);
c.add(login);
c.add(end);
setTitle("Login Check");
setSize(400,200);
setLocation((800-400)/2,(600-165)/2);
pack();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
JButton btn = (JButton)ae.getSource();
if(btn == end)
{
System.exit(0);
}
if(btn == login)
{
try
{
String user = nameText.getText();
String pass = new String(passText.getPassword());
if(user.compareTo(pass)==0)
{
JOptionPane.showMessageDialog(null,"Login
Successful","Login",JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}
else
{
throw new InvalidPasswordException();
}
}
catch(Exception e)
{
attempt++;
JOptionPane.showMessageDialog(null,"Login
Failed","Login",JOptionPane.ERROR_MESSAGE);
nameText.setText("");
passText.setText("");
c.add(nameText);
c.add(pass);
c.add(passText);
c.add(login);
c.add(end);
setTitle("Login Check");
setSize(400,200);
setLocation((800-400)/2,(600-165)/2);
pack();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
JButton btn = (JButton)ae.getSource();
if(btn == end)
{
System.exit(0);
}
if(btn == login)
{
try
{
String user = nameText.getText();
String pass = new String(passText.getPassword());
if(user.compareTo(pass)==0)
{
JOptionPane.showMessageDialog(null,"Login
Successful","Login",JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}
else
{
throw new InvalidPasswordException();
}
}
catch(Exception e)
{
attempt++;
JOptionPane.showMessageDialog(null,"Login
Failed","Login",JOptionPane.ERROR_MESSAGE);
nameText.setText("");
passText.setText("");

nameText.requestFocus();
if(attempt == 3)
{
JOptionPane.showMessageDialog(null,"3 Attempts
Over","Login",JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
}
}
}
public static void main(String args[])
{
new Login();
}
}
Register
public class Register extends JFrame implements ActionListener
{
private JMenu mnuHelp;
private JMenu mnuFiles;
private JMenuBar menubar;
private JMenuItem mnuForm;
private JMenuItem mnuAbt;
private JMenuItem mnuExit;
private JMenuItem Help;
private JButton button[]=new JButton[20];
private JTextField text[]=new JTextField[20];
private JComboBox nationCombo = new JComboBox();
private JLabel label[]=new JLabel[20];
private int i=0,j=0,k=0;
public Register()
{
super("Voting System - Voter Registration");
Container con = getContentPane();
con.setLayout(null);
menubar=new JMenuBar();
setJMenuBar(menubar);
mnuHelp = new JMenu("Help");
mnuHelp.setMnemonic('H');
if(attempt == 3)
{
JOptionPane.showMessageDialog(null,"3 Attempts
Over","Login",JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
}
}
}
public static void main(String args[])
{
new Login();
}
}
Register
public class Register extends JFrame implements ActionListener
{
private JMenu mnuHelp;
private JMenu mnuFiles;
private JMenuBar menubar;
private JMenuItem mnuForm;
private JMenuItem mnuAbt;
private JMenuItem mnuExit;
private JMenuItem Help;
private JButton button[]=new JButton[20];
private JTextField text[]=new JTextField[20];
private JComboBox nationCombo = new JComboBox();
private JLabel label[]=new JLabel[20];
private int i=0,j=0,k=0;
public Register()
{
super("Voting System - Voter Registration");
Container con = getContentPane();
con.setLayout(null);
menubar=new JMenuBar();
setJMenuBar(menubar);
mnuHelp = new JMenu("Help");
mnuHelp.setMnemonic('H');
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

mnuFiles = new JMenu("Files");
mnuFiles.setMnemonic('F');
mnuForm=new JMenuItem("New Registration Form");
mnuForm.setMnemonic('R');
mnuFiles.add(mnuForm);
mnuForm.addActionListener(this);
mnuAbt=new JMenuItem("About");
mnuAbt.setMnemonic('A');
mnuFiles.add(mnuAbt);
mnuAbt.addActionListener(this);
mnuExit=new JMenuItem("Exit");
mnuExit.setMnemonic('E');
mnuFiles.add(mnuExit);
mnuExit.addActionListener(this);
Help=new JMenuItem(" About help F1");
//Help.addActionListener(this);
Help.setMnemonic('F');
mnuHelp.add(Help);
menubar.add(mnuFiles);
menubar.add(mnuHelp);
label[i]=new JLabel("VOTER REGISTRATION PROCESS");
label[i].setFont(new Font("TimesNewRoman",Font.BOLD,20));
label[i].setBounds(220,20,650,30);
con.add(label[i]);
i=i+1;
label[i]=new JLabel("# A User has to Register Himself before He is
ellegibe for Voting.");
label[i].setFont(new Font("MonoSpaced",Font.BOLD,15));
label[i].setBounds(45,63,750,30);
con.add(label[i]);
i=i+1;
label[i]=new JLabel("# A User Has to fill following Entries in order to
Register Himself as Voter. ");
label[i].setFont(new Font("MonoSpaced",Font.BOLD,15));
label[i].setBounds(45,88,750,30);
con.add(label[i]);
i=i+1;
mnuFiles.setMnemonic('F');
mnuForm=new JMenuItem("New Registration Form");
mnuForm.setMnemonic('R');
mnuFiles.add(mnuForm);
mnuForm.addActionListener(this);
mnuAbt=new JMenuItem("About");
mnuAbt.setMnemonic('A');
mnuFiles.add(mnuAbt);
mnuAbt.addActionListener(this);
mnuExit=new JMenuItem("Exit");
mnuExit.setMnemonic('E');
mnuFiles.add(mnuExit);
mnuExit.addActionListener(this);
Help=new JMenuItem(" About help F1");
//Help.addActionListener(this);
Help.setMnemonic('F');
mnuHelp.add(Help);
menubar.add(mnuFiles);
menubar.add(mnuHelp);
label[i]=new JLabel("VOTER REGISTRATION PROCESS");
label[i].setFont(new Font("TimesNewRoman",Font.BOLD,20));
label[i].setBounds(220,20,650,30);
con.add(label[i]);
i=i+1;
label[i]=new JLabel("# A User has to Register Himself before He is
ellegibe for Voting.");
label[i].setFont(new Font("MonoSpaced",Font.BOLD,15));
label[i].setBounds(45,63,750,30);
con.add(label[i]);
i=i+1;
label[i]=new JLabel("# A User Has to fill following Entries in order to
Register Himself as Voter. ");
label[i].setFont(new Font("MonoSpaced",Font.BOLD,15));
label[i].setBounds(45,88,750,30);
con.add(label[i]);
i=i+1;

label[i]=new JLabel("# A User Has to fill Correct Entries in
Corresponding TextFields in order to Register Himself as Voter. ");
label[i].setFont(new Font("MonoSpaced",Font.BOLD,12));
label[i].setBounds(45,120,750,30);
con.add(label[i]);
i=i+1;
label[i]=new JLabel("1.Voter Name:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,165,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 165, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if (!((c >= 'A' ||c >= 'a' ) && (c <='Z'||c <='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("3.VoterID:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,200,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 200, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
Corresponding TextFields in order to Register Himself as Voter. ");
label[i].setFont(new Font("MonoSpaced",Font.BOLD,12));
label[i].setBounds(45,120,750,30);
con.add(label[i]);
i=i+1;
label[i]=new JLabel("1.Voter Name:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,165,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 165, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if (!((c >= 'A' ||c >= 'a' ) && (c <='Z'||c <='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("3.VoterID:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,200,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 200, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();

if (!((c >= 'A' ||c >= 'a' ||c >= '0' ||c >= '9' ) && (c <='Z'||c
<='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("5.Password:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,250,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JPasswordField(20);
text[j].setBounds(160, 250, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
j=j+1;
label[i]=new JLabel("6.Voter Phone No.:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,300,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 300, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if(!((c >= '0' && c <='9' )||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
<='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("5.Password:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,250,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JPasswordField(20);
text[j].setBounds(160, 250, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
j=j+1;
label[i]=new JLabel("6.Voter Phone No.:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,300,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 300, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if(!((c >= '0' && c <='9' )||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

}
});
j=j+1;
label[i]=new JLabel("7.Voter Adderess:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,350,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 350, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if (!((c >= 'A' ||c >= 'a' ||c >= '0' ||c >= '9' ) && (c <='Z'||c
<='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("8.Date of Birth:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,400,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 400, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
});
j=j+1;
label[i]=new JLabel("7.Voter Adderess:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,350,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 350, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if (!((c >= 'A' ||c >= 'a' ||c >= '0' ||c >= '9' ) && (c <='Z'||c
<='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("8.Date of Birth:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,400,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(160, 400, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();

if (!((c >= 'A' ||c >= 'a' ||c >= '0' ||c >= '9' ) && (c <='Z'||c
<='z' )||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("9.Nationality:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,450,750,30);
con.add(label[i]);
i=i+1;
nationCombo.addItem("India");
nationCombo.addItem("USA");
nationCombo.addItem("England");
nationCombo.addItem("Pakistan");
nationCombo.addItem("Russia");
nationCombo.addItem("Japan");
nationCombo.addItem("China");
nationCombo.addItem("Brazil");
nationCombo.addItem("Germany");
nationCombo.setBounds(160, 450, 210, 20);
con.add(nationCombo);
j=j+1;
label[i]=new JLabel("2.Voter Middle Name:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(400,165,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(560, 165, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
<='z' )||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("9.Nationality:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(15,450,750,30);
con.add(label[i]);
i=i+1;
nationCombo.addItem("India");
nationCombo.addItem("USA");
nationCombo.addItem("England");
nationCombo.addItem("Pakistan");
nationCombo.addItem("Russia");
nationCombo.addItem("Japan");
nationCombo.addItem("China");
nationCombo.addItem("Brazil");
nationCombo.addItem("Germany");
nationCombo.setBounds(160, 450, 210, 20);
con.add(nationCombo);
j=j+1;
label[i]=new JLabel("2.Voter Middle Name:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(400,165,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(560, 165, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {

char c = e.getKeyChar();
if (!((c >= 'A' ||c >= 'a' ) && (c <='Z'||c <='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("4.Voter Last Name:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(400,200,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(560, 200, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if (!((c >= 'A' ||c >= 'a' ) && (c <='Z'||c <='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
button[i]=new JButton("Register");
button[i].setBounds(560,480,100,30);
con.add(button[i]);
System.out.println("I: "+i);
System.out.println("J: "+j);
System.out.println("K: "+k);
if (!((c >= 'A' ||c >= 'a' ) && (c <='Z'||c <='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
label[i]=new JLabel("4.Voter Last Name:");
label[i].setFont(new Font("Arial",Font.ITALIC,15));
label[i].setBounds(400,200,750,30);
con.add(label[i]);
i=i+1;
text[j]=new JTextField(20);
text[j].setBounds(560, 200, 210, 20);//(z,y,w,h)
text[j].setFont(new Font("Arial",Font.BOLD,13));
con.add(text[j]);
text[j].addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if (!((c >= 'A' ||c >= 'a' ) && (c <='Z'||c <='z' ) ||
(c == KeyEvent.VK_BACK_SPACE) ||
(c == KeyEvent.VK_DELETE))) {
getToolkit().beep();
e.consume();
}
}
});
j=j+1;
button[i]=new JButton("Register");
button[i].setBounds(560,480,100,30);
con.add(button[i]);
System.out.println("I: "+i);
System.out.println("J: "+j);
System.out.println("K: "+k);
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
setSize(800,600);
setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==mnuForm)
{
for(k=0;k<20;k++)
{
text[k].setText("");
}
}
if(ae.getSource()==mnuExit)
{
int ai= JOptionPane.showConfirmDialog(null, "Are you
sure you want to exit?", " Client Model", JOptionPane.YES_NO_OPTION);
if(ai==0)
System.exit(0);
}
if(ae.getSource()==mnuAbt)
{
String msg ;
msg = "# This is a Voter Registration Panel \n";
msg += "# This pannel can be Used by User to Register
Himself as Voter.\n";
msg += "# The Voter id,phone no, should be a Integer
value\n";
msg += "# The Birth Date of a Voter should be in format
of 26Sep1987\n";
JOptionPane.showMessageDialog(null, msg, " Client",
JOptionPane.INFORMATION_MESSAGE );
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
setSize(800,600);
setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==mnuForm)
{
for(k=0;k<20;k++)
{
text[k].setText("");
}
}
if(ae.getSource()==mnuExit)
{
int ai= JOptionPane.showConfirmDialog(null, "Are you
sure you want to exit?", " Client Model", JOptionPane.YES_NO_OPTION);
if(ai==0)
System.exit(0);
}
if(ae.getSource()==mnuAbt)
{
String msg ;
msg = "# This is a Voter Registration Panel \n";
msg += "# This pannel can be Used by User to Register
Himself as Voter.\n";
msg += "# The Voter id,phone no, should be a Integer
value\n";
msg += "# The Birth Date of a Voter should be in format
of 26Sep1987\n";
JOptionPane.showMessageDialog(null, msg, " Client",
JOptionPane.INFORMATION_MESSAGE );

}
}
public static void main(String args[])
{
new Register();
}
private class StrictInputVerifier extends InputVerifier {
private String validString;
public StrictInputVerifier(String validString) {
this.validString = validString;
}
public boolean verify(JComponent input) {
System.out.println("FD");
JTextField textField = (JTextField) input;
boolean retCode = false;
try {
Integer.parseInt(textField.getText());
retCode = true;
}
catch(Exception e) {
}
return retCode;
}
Result Module
Bar-graph
class Bargraph extends JFrame {
BuildBarGraph bargraph;
public Bargraph() {
buildWindow();
}
protected void buildWindow() {
Container con=getContentPane();
bargraph=new BuildBarGraph();
addWindowListener(new WindowAdapter()
}
public static void main(String args[])
{
new Register();
}
private class StrictInputVerifier extends InputVerifier {
private String validString;
public StrictInputVerifier(String validString) {
this.validString = validString;
}
public boolean verify(JComponent input) {
System.out.println("FD");
JTextField textField = (JTextField) input;
boolean retCode = false;
try {
Integer.parseInt(textField.getText());
retCode = true;
}
catch(Exception e) {
}
return retCode;
}
Result Module
Bar-graph
class Bargraph extends JFrame {
BuildBarGraph bargraph;
public Bargraph() {
buildWindow();
}
protected void buildWindow() {
Container con=getContentPane();
bargraph=new BuildBarGraph();
addWindowListener(new WindowAdapter()

{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
con.add(bargraph);
setTitle("BAR-CHART");
setSize(800,600);
setVisible(true);
}
public static void main(String []args) {
new Bargraph();
}
}
class BuildBarGraph extends JPanel
{
private Map<String,Integer> pieData;
BuildBarGraph()
{
pieData = new TreeMap<String,Integer>();
initializeData();
setBackground(Color.white);
}
protected void initializeData() {
pieData.put("A",270);
pieData.put("B",150);
pieData.put("C", 245);
pieData.put("D",200);
pieData.put("Others", 110);
}
int Tvotes ;
double percentage;
int Vote1,Vote,Iangle =90,n = 0;
int color1 =20,color2 =25,color3 = 50,X_axixs = 100,Y_axixs = 300;
public void paintComponent(Graphics g)
{
super.paintComponents(g);
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
con.add(bargraph);
setTitle("BAR-CHART");
setSize(800,600);
setVisible(true);
}
public static void main(String []args) {
new Bargraph();
}
}
class BuildBarGraph extends JPanel
{
private Map<String,Integer> pieData;
BuildBarGraph()
{
pieData = new TreeMap<String,Integer>();
initializeData();
setBackground(Color.white);
}
protected void initializeData() {
pieData.put("A",270);
pieData.put("B",150);
pieData.put("C", 245);
pieData.put("D",200);
pieData.put("Others", 110);
}
int Tvotes ;
double percentage;
int Vote1,Vote,Iangle =90,n = 0;
int color1 =20,color2 =25,color3 = 50,X_axixs = 100,Y_axixs = 300;
public void paintComponent(Graphics g)
{
super.paintComponents(g);
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

Set<String> keySet = pieData.keySet();
Iterator<String> keyIterator = keySet.iterator();
while(keyIterator.hasNext())
{
String partyName = keyIterator.next();
pieData.get(partyName);
Vote1 = pieData.get(partyName);
Tvotes=Tvotes+Vote1;
}
Set<String> keySet1 = pieData.keySet();
Iterator<String> keyIterator1 = keySet1.iterator();
while(keyIterator1.hasNext())
{
double Tvotes2=(double)Tvotes;
String partyName1 = keyIterator1.next();
pieData.get(partyName1);
System.out.println(partyName1);
Vote = pieData.get(partyName1);
System.out.println("Vote \t" +Vote);
System.out.println("Total Votes \t" +Tvotes2);
percentage=(Vote/Tvotes2)*100;
System.out.println("Percentage \t" +percentage);
double deg1=(percentage/100)*360;
int degree1=(int) deg1;
System.out.println("DEGREE \t\t"+degree1);
n=n+1;
if(n==1)
g.setColor(Color.BLACK);
if(n==2)
g.setColor(Color.BLUE);
if(n==3)
Iterator<String> keyIterator = keySet.iterator();
while(keyIterator.hasNext())
{
String partyName = keyIterator.next();
pieData.get(partyName);
Vote1 = pieData.get(partyName);
Tvotes=Tvotes+Vote1;
}
Set<String> keySet1 = pieData.keySet();
Iterator<String> keyIterator1 = keySet1.iterator();
while(keyIterator1.hasNext())
{
double Tvotes2=(double)Tvotes;
String partyName1 = keyIterator1.next();
pieData.get(partyName1);
System.out.println(partyName1);
Vote = pieData.get(partyName1);
System.out.println("Vote \t" +Vote);
System.out.println("Total Votes \t" +Tvotes2);
percentage=(Vote/Tvotes2)*100;
System.out.println("Percentage \t" +percentage);
double deg1=(percentage/100)*360;
int degree1=(int) deg1;
System.out.println("DEGREE \t\t"+degree1);
n=n+1;
if(n==1)
g.setColor(Color.BLACK);
if(n==2)
g.setColor(Color.BLUE);
if(n==3)

g.setColor(Color.CYAN);
if(n==4)
g.setColor(Color.DARK_GRAY);
if(n==5)
g.setColor(Color.RED);
if(n==6)
g.setColor(Color.PINK);
if(n==6)
g.setColor(Color.PINK);
if(n==7)
g.setColor(Color.ORANGE);
if(n>7)
{
Color color4=new Color(color1,color2,color3);
g.setColor(color4);
}
g.drawString(partyName1,X_axixs,520);
g.fillRect(X_axixs,500-Vote,50,Vote);
X_axixs=X_axixs+80;
color1=color1+25;
color2=color2+25;
color3=color3+25;
System.out.println("\n\n");
}
String label="BAR-CHART";
Font font=new Font("ArialBlack",Font.ITALIC,20);
g.drawRect(30,60,700,500);
g.setColor(Color.black);
g.setFont(font);
g.drawString(label,320,100);
}/* End of paint Component Method */
}/* End of BuildBarGraph classs*/
Pie Graph
class Piegraph extends JFrame {
PiegraphBuild pie1;
public Piegraph() {
buildWindow();
if(n==4)
g.setColor(Color.DARK_GRAY);
if(n==5)
g.setColor(Color.RED);
if(n==6)
g.setColor(Color.PINK);
if(n==6)
g.setColor(Color.PINK);
if(n==7)
g.setColor(Color.ORANGE);
if(n>7)
{
Color color4=new Color(color1,color2,color3);
g.setColor(color4);
}
g.drawString(partyName1,X_axixs,520);
g.fillRect(X_axixs,500-Vote,50,Vote);
X_axixs=X_axixs+80;
color1=color1+25;
color2=color2+25;
color3=color3+25;
System.out.println("\n\n");
}
String label="BAR-CHART";
Font font=new Font("ArialBlack",Font.ITALIC,20);
g.drawRect(30,60,700,500);
g.setColor(Color.black);
g.setFont(font);
g.drawString(label,320,100);
}/* End of paint Component Method */
}/* End of BuildBarGraph classs*/
Pie Graph
class Piegraph extends JFrame {
PiegraphBuild pie1;
public Piegraph() {
buildWindow();

}
protected void buildWindow() {
Container con=getContentPane();
pie1=new PiegraphBuild();
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
con.add(pie1);
setTitle("PIE-CHART");
setSize(800,600);
setVisible(true);
}
public static void main(String []args) {
new Piegraph();
}
}
class PiegraphBuild extends JPanel
{
private Map<String,Integer> pieData;
PiegraphBuild()
{
pieData = new TreeMap<String,Integer>();
initializeData();
setBackground(Color.white);
}
protected void initializeData() {
pieData.put("A",1170);
pieData.put("B",170);
pieData.put("C", 170);
pieData.put("D",170);
pieData.put("Others", 170);
protected void buildWindow() {
Container con=getContentPane();
pie1=new PiegraphBuild();
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
con.add(pie1);
setTitle("PIE-CHART");
setSize(800,600);
setVisible(true);
}
public static void main(String []args) {
new Piegraph();
}
}
class PiegraphBuild extends JPanel
{
private Map<String,Integer> pieData;
PiegraphBuild()
{
pieData = new TreeMap<String,Integer>();
initializeData();
setBackground(Color.white);
}
protected void initializeData() {
pieData.put("A",1170);
pieData.put("B",170);
pieData.put("C", 170);
pieData.put("D",170);
pieData.put("Others", 170);
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

}
int Tvotes ;
double percentage;
int Vote1,Vote,Iangle=90,n=0;
int color1=25 ,color2=50,color3=75,X_axixs=80;
public void paintComponent(Graphics g)
{
super.paintComponents(g);
Set<String> keySet = pieData.keySet();
Iterator<String> keyIterator = keySet.iterator();
while(keyIterator.hasNext())
{
String partyName = keyIterator.next();
pieData.get(partyName);
Vote1 = pieData.get(partyName);
Tvotes=Tvotes+Vote1;
}
Set<String> keySet1 = pieData.keySet();
Iterator<String> keyIterator1 = keySet1.iterator();
while(keyIterator1.hasNext())
{
double Tvotes2=(double)Tvotes;
String partyName1 = keyIterator1.next();
pieData.get(partyName1);
System.out.println(partyName1);
Vote = pieData.get(partyName1);
System.out.println("Vote \t" +Vote);
System.out.println("Total Votes \t" +Tvotes2);
percentage=(Vote/Tvotes2)*100;
System.out.println("Percentage \t" +percentage);
int Tvotes ;
double percentage;
int Vote1,Vote,Iangle=90,n=0;
int color1=25 ,color2=50,color3=75,X_axixs=80;
public void paintComponent(Graphics g)
{
super.paintComponents(g);
Set<String> keySet = pieData.keySet();
Iterator<String> keyIterator = keySet.iterator();
while(keyIterator.hasNext())
{
String partyName = keyIterator.next();
pieData.get(partyName);
Vote1 = pieData.get(partyName);
Tvotes=Tvotes+Vote1;
}
Set<String> keySet1 = pieData.keySet();
Iterator<String> keyIterator1 = keySet1.iterator();
while(keyIterator1.hasNext())
{
double Tvotes2=(double)Tvotes;
String partyName1 = keyIterator1.next();
pieData.get(partyName1);
System.out.println(partyName1);
Vote = pieData.get(partyName1);
System.out.println("Vote \t" +Vote);
System.out.println("Total Votes \t" +Tvotes2);
percentage=(Vote/Tvotes2)*100;
System.out.println("Percentage \t" +percentage);

double deg1=(percentage/100)*360;
int degree1=(int) deg1;
System.out.println("DEGREE \t\t"+degree1);
n=n+1;
if(n==1)
g.setColor(Color.BLACK);
if(n==2)
g.setColor(Color.ORANGE);
if(n==3)
g.setColor(Color.BLUE);
if(n==4)
g.setColor(Color.DARK_GRAY);
if(n==5)
g.setColor(Color.RED);
if(n==6)
g.setColor(Color.PINK);
if(n==7)
g.setColor(Color.GREEN);
if(n>8)
{
Color color4=new Color(color1,color2,color3);
g.setColor(color4);
}
g.drawString(partyName1,X_axixs,500);
X_axixs=X_axixs+80;
g.fillArc(300,200,201,201,Iangle,degree1);
Iangle=Iangle+degree1;
color1=color1+25;
color2=color2+25;
color3=color3+25;
System.out.println("\n\n");
}
String label="PIE-CHART";
Font font=new Font("ArialBlack",Font.ITALIC,20);
g.drawRect(30,50,720,460);
int degree1=(int) deg1;
System.out.println("DEGREE \t\t"+degree1);
n=n+1;
if(n==1)
g.setColor(Color.BLACK);
if(n==2)
g.setColor(Color.ORANGE);
if(n==3)
g.setColor(Color.BLUE);
if(n==4)
g.setColor(Color.DARK_GRAY);
if(n==5)
g.setColor(Color.RED);
if(n==6)
g.setColor(Color.PINK);
if(n==7)
g.setColor(Color.GREEN);
if(n>8)
{
Color color4=new Color(color1,color2,color3);
g.setColor(color4);
}
g.drawString(partyName1,X_axixs,500);
X_axixs=X_axixs+80;
g.fillArc(300,200,201,201,Iangle,degree1);
Iangle=Iangle+degree1;
color1=color1+25;
color2=color2+25;
color3=color3+25;
System.out.println("\n\n");
}
String label="PIE-CHART";
Font font=new Font("ArialBlack",Font.ITALIC,20);
g.drawRect(30,50,720,460);

g.setColor(Color.black);
g.setFont(font);
g.drawString(label,360,150);
}
}
g.setFont(font);
g.drawString(label,360,150);
}
}
1 out of 34
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
 +13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024  |  Zucol Services PVT LTD  |  All rights reserved.